use of org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.ImmutableACL in project jackrabbit-oak by apache.
the class AccessControlManagerImpl method createACL.
@CheckForNull
private JackrabbitAccessControlList createACL(@Nullable String oakPath, @Nonnull Tree accessControlledTree, boolean isEffectivePolicy, @CheckForNull Predicate<ACE> predicate) throws RepositoryException {
JackrabbitAccessControlList acl = null;
String aclName = Util.getAclName(oakPath);
if (accessControlledTree.exists() && Util.isAccessControlled(oakPath, accessControlledTree, ntMgr)) {
Tree aclTree = accessControlledTree.getChild(aclName);
if (aclTree.exists()) {
List<ACE> entries = new ArrayList<ACE>();
for (Tree child : aclTree.getChildren()) {
if (Util.isACE(child, ntMgr)) {
ACE ace = createACE(oakPath, child, restrictionProvider);
if (predicate == null || predicate.apply(ace)) {
entries.add(ace);
}
}
}
if (isEffectivePolicy) {
acl = new ImmutableACL(oakPath, entries, restrictionProvider, getNamePathMapper());
} else {
acl = new NodeACL(oakPath, entries);
}
}
}
return acl;
}
Aggregations