[
https://issues.apache.org/jira/browse/JCR-3923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16348836#comment-16348836
]
angela edited comment on JCR-3923 at 2/1/18 4:21 PM:
-----------------------------------------------------
[~reschke], it should also work on the root node. I don't know about
jackrabbit-core but afaik it works with Oak (there should even be some test
case if i remember correctly). One common mistake though is that the specified
pattern is defined with a leading path, which on the root node will result in
an invalid path that is never matched as the GlobPattern just concatenates
string.
in any case issues with Oak should be reported with the Oak project as it's a
separate code base with a separate jira bucket.
was (Author: anchela):
[~reschke], it should also work on the root node. I don't know about
jackrabbit-core but afaik it works with Oak (there should even be some test
case if i remember correctly). One common mistake though is that the specified
pattern is defined with a leading path, which on the root node will result in
an invalid path that is never matched as the GlobPattern just concatenates
string.
> Repository root doesn't respect rep:glob
> ----------------------------------------
>
> Key: JCR-3923
> URL: https://issues.apache.org/jira/browse/JCR-3923
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Reporter: Kamil
> Priority: Major
>
> I have following node structure:
> {noformat}
> /test
> /test/child
> /foo
> {noformat}
> When I set Principal based privileges to some user as:
> {noformat}
> Map<String, Value> restrictions = new HashMap<String, Value>();
> ValueFactory vf = session.getValueFactory();
> restrictions.put("rep:nodePath", vf.createValue("/test", PropertyType.PATH));
> restrictions.put("rep:glob", vf.createValue(""));
>
> jacl.addEntry(principal, privileges, allow, restrictions);
>
> acManager.setPolicy(jacl.getPath(), jacl);
> session.save();
> {noformat}
> where according to this documentation
> http://jackrabbit.apache.org/api/2.2/org/apache/jackrabbit/core/security/authorization/GlobPattern.html
> empty string means "matches /foo only", user can see only:
> {noformat}
> /test
> {noformat}
> without a child, which is correct. But when I set:
> {noformat}
> Map<String, Value> restrictions = new HashMap<String, Value>();
> ValueFactory vf = session.getValueFactory();
> restrictions.put("rep:nodePath", vf.createValue("/", PropertyType.PATH));
> restrictions.put("rep:glob", vf.createValue(""));
>
> jacl.addEntry(principal, privileges, allow, restrictions);
>
> acManager.setPolicy(jacl.getPath(), jacl);
> session.save();
> {noformat}
> then user can see all descendants of root:
> {noformat}
> /test
> /test/child
> /foo
> {noformat}
> which is not correct
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)