use of org.apache.jackrabbit.oak.plugins.tree.TreeType in project jackrabbit-oak by apache.
the class CugPermissionProvider method canRead.
private boolean canRead(@Nonnull Tree tree) {
Tree immutableTree = getImmutableTree(tree);
TreeType type = typeProvider.getType(immutableTree);
if (!isSupportedType(type) || !topPaths.hasAny()) {
return false;
}
Tree cugRoot = getCugRoot(immutableTree, type);
if (cugRoot != null) {
Tree cugTree = CugUtil.getCug(cugRoot);
if (cugTree != null) {
return isAllow(cugTree);
}
}
return false;
}
use of org.apache.jackrabbit.oak.plugins.tree.TreeType in project jackrabbit-oak by apache.
the class CompiledPermissionImpl method buildParentPermission.
@Nonnull
private TreePermission buildParentPermission(@Nonnull Tree tree) {
List<Tree> trees = new ArrayList<Tree>();
while (!tree.isRoot()) {
tree = tree.getParent();
trees.add(0, tree);
}
TreePermission pp = EMPTY;
TreeType type = TreeType.DEFAULT;
for (Tree tr : trees) {
type = typeProvider.getType(tr, type);
pp = new TreePermissionImpl(tr, type, pp);
}
return pp;
}
Aggregations