use of org.apache.jackrabbit.oak.plugins.tree.impl.AbstractTree in project jackrabbit-oak by apache.
the class EmptyCugTreePermissionTest method before.
@Override
public void before() throws Exception {
super.before();
createCug(SUPPORTED_PATH, EveryonePrincipal.getInstance());
root.commit();
pp = createCugPermissionProvider(ImmutableSet.of(SUPPORTED_PATH, SUPPORTED_PATH2), getTestUser().getPrincipal(), EveryonePrincipal.getInstance());
Root readOnlyRoot = RootFactory.createReadOnlyRoot(root);
Tree t = readOnlyRoot.getTree("/");
tp = new EmptyCugTreePermission(t, TreeType.DEFAULT, pp);
rootState = ((AbstractTree) t).getNodeState();
}
use of org.apache.jackrabbit.oak.plugins.tree.impl.AbstractTree in project jackrabbit-oak by apache.
the class CugTreePermissionTest method testGetChildPermission.
@Test
public void testGetChildPermission() throws Exception {
NodeState ns = ((AbstractTree) root.getTree(SUPPORTED_PATH + "/subtree")).getNodeState();
TreePermission child = allowedTp.getChildPermission("subtree", ns);
assertTrue(child instanceof CugTreePermission);
child = deniedTp.getChildPermission("subtree", ns);
assertTrue(child instanceof CugTreePermission);
NodeState cugNs = ((AbstractTree) root.getTree(PathUtils.concat(SUPPORTED_PATH, REP_CUG_POLICY))).getNodeState();
TreePermission cugChild = allowedTp.getChildPermission(REP_CUG_POLICY, cugNs);
assertSame(TreePermission.NO_RECOURSE, cugChild);
}
Aggregations