use of org.apache.jackrabbit.oak.spi.security.authorization.permission.TreePermission in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testGetTreePermissionInstance.
@Test
public void testGetTreePermissionInstance() throws Exception {
PermissionProvider pp = createPermissionProvider();
TreePermission parentPermission = TreePermission.EMPTY;
for (String path : TP_PATHS) {
TreePermission tp = pp.getTreePermission(readOnlyRoot.getTree(path), parentPermission);
assertCompositeTreePermission(tp);
parentPermission = tp;
}
}
use of org.apache.jackrabbit.oak.spi.security.authorization.permission.TreePermission in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testGetTreePermissionAllParent.
@Test
public void testGetTreePermissionAllParent() throws Exception {
TreePermission tp = createPermissionProvider().getTreePermission(readOnlyRoot.getTree(TEST_PATH), TreePermission.ALL);
assertSame(TreePermission.ALL, tp);
}
use of org.apache.jackrabbit.oak.spi.security.authorization.permission.TreePermission in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testGetTreePermissionEmptyParent.
@Test
public void testGetTreePermissionEmptyParent() throws Exception {
TreePermission tp = createPermissionProvider().getTreePermission(readOnlyRoot.getTree(TEST_PATH), TreePermission.EMPTY);
assertSame(TreePermission.EMPTY, tp);
}
use of org.apache.jackrabbit.oak.spi.security.authorization.permission.TreePermission in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testTreePermissionIsGrantedAll.
@Test
public void testTreePermissionIsGrantedAll() throws Exception {
PermissionProvider pp = createPermissionProvider();
TreePermission parentPermission = TreePermission.EMPTY;
PropertyState ps = PropertyStates.createProperty("propName", "val");
for (String path : TP_PATHS) {
Tree t = readOnlyRoot.getTree(path);
TreePermission tp = pp.getTreePermission(t, parentPermission);
assertFalse(tp.isGranted(Permissions.ALL));
assertFalse(tp.isGranted(Permissions.ALL, ps));
parentPermission = tp;
}
}
use of org.apache.jackrabbit.oak.spi.security.authorization.permission.TreePermission in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testTreePermissionGetChild.
@Test
public void testTreePermissionGetChild() throws Exception {
List<String> childNames = ImmutableList.of("test", "a", "b", "c", "nonexisting");
Tree rootTree = readOnlyRoot.getTree(ROOT_PATH);
NodeState ns = ((ImmutableTree) rootTree).getNodeState();
TreePermission tp = createPermissionProvider().getTreePermission(rootTree, TreePermission.EMPTY);
for (String cName : childNames) {
ns = ns.getChildNode(cName);
tp = tp.getChildPermission(cName, ns);
assertCompositeTreePermission(tp);
}
}
Aggregations