You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Angela Schreiber (Jira)" <ji...@apache.org> on 2020/12/03 12:44:00 UTC
[jira] [Comment Edited] (SLING-9959) DefaultAclManager: path with
create system user needs to be intermediate path
[ https://issues.apache.org/jira/browse/SLING-9959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17243161#comment-17243161 ]
Angela Schreiber edited comment on SLING-9959 at 12/3/20, 12:43 PM:
--------------------------------------------------------------------
update: i verified this again with using the test-content from SLING-9970.... {{SystemUser.getPath}} in fact does point to the parent node, which IMHO is quite confusing given the name of the method.
but the following line in {{SystemUserEntryHandler}} makes it point to the parent folder node:[https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/master/src/main/java/org/apache/sling/feature/cpconverter/handlers/SystemUsersEntryHandler.java#L45]
{code:java}
RepoPath currentPath = new RepoPath(path).getParent(); {code}
to make this less confusing i would suggest to
- create {{SystemUser}} with the actual user path
- let {{SystemUser.getPath}} return the user path
- add {{SystemUser.getIntermediatePath()}} to make sure the right path is used for the 'intermediate path' statement of the 'create system user' repo-init statement.
was (Author: anchela):
update: i verified this again with using the test-content from SLING-9970.... {{SystemUser.getPath}} in fact does point to the parent node, which IMHO is quite confusing given the name of the method.
but the following line in {{SystemUserEntryHandler}} makes it point to the parent folder node:[https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/master/src/main/java/org/apache/sling/feature/cpconverter/handlers/SystemUsersEntryHandler.java#L45]
{code:java}
RepoPath currentPath = new RepoPath(path).getParent(); {code}
> DefaultAclManager: path with create system user needs to be intermediate path
> -----------------------------------------------------------------------------
>
> Key: SLING-9959
> URL: https://issues.apache.org/jira/browse/SLING-9959
> Project: Sling
> Issue Type: Bug
> Components: Content-Package to Feature Model Converter
> Reporter: Angela Schreiber
> Priority: Major
> Fix For: Content-Package to Feature Model Converter 1.0.24
>
>
> found the following repo-init statement to create system users:
> https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/master/src/main/java/org/apache/sling/feature/cpconverter/acl/DefaultAclManager.java#L109
> which states:
> {code}
> formatter.format("create service user %s with path %s%n", systemUser.getId(), systemUser.getPath());
> {code}
> now.... i might be mistaken, but if my reading of the {{SystemUserParser}} is correct, the path defined with the {{SystemUser}} instance actually reflects the path of the system user node itself:
> https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/master/src/main/java/org/apache/sling/feature/cpconverter/handlers/SystemUsersEntryHandler.java#L70-L75
> if that was true the repo-init statements would be wrong, because the path argument doesn't specify that path of the user node itself but rather the intermediate path to be used.
> so the statement should probably read:
> {code}
> formatter.format("create service user %s with path %s%n", systemUser.getId(), systemUser.getParent().getPath());
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)