use of org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testTreePermissionIsNotGrantedOR.
@Test
public void testTreePermissionIsNotGrantedOR() throws Exception {
PermissionProvider pp = createPermissionProviderOR();
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.NO_PERMISSION));
assertFalse(tp.isGranted(Permissions.MODIFY_ACCESS_CONTROL));
assertFalse(tp.isGranted(Permissions.NO_PERMISSION, ps));
assertFalse(tp.isGranted(Permissions.MODIFY_ACCESS_CONTROL, ps));
parentPermission = tp;
}
}
use of org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testIsGrantedAll.
@Test
public void testIsGrantedAll() throws Exception {
PermissionProvider pp = createPermissionProvider();
PermissionProvider ppo = createPermissionProviderOR();
for (String p : NODE_PATHS) {
Tree tree = readOnlyRoot.getTree(p);
PropertyState ps = tree.getProperty(JcrConstants.JCR_PRIMARYTYPE);
assertFalse(p, pp.isGranted(tree, null, Permissions.ALL));
assertFalse(PathUtils.concat(p, JcrConstants.JCR_PRIMARYTYPE), pp.isGranted(tree, ps, Permissions.ALL));
assertFalse(p, ppo.isGranted(tree, null, Permissions.ALL));
assertFalse(PathUtils.concat(p, JcrConstants.JCR_PRIMARYTYPE), ppo.isGranted(tree, ps, Permissions.ALL));
}
}
use of org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testHasPrivilegesNone.
@Test
public void testHasPrivilegesNone() throws Exception {
PermissionProvider pp = createPermissionProvider();
PermissionProvider ppo = createPermissionProviderOR();
for (String p : NODE_PATHS) {
Tree tree = readOnlyRoot.getTree(p);
assertTrue(p, pp.hasPrivileges(tree));
assertTrue(p, ppo.hasPrivileges(tree));
}
}
use of org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testGetTreePermissionInstanceOR.
@Test
public void testGetTreePermissionInstanceOR() throws Exception {
PermissionProvider pp = createPermissionProviderOR();
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.PermissionProvider in project jackrabbit-oak by apache.
the class AbstractCompositeProviderTest method testHasPrivilegesOnRepoJcrAll.
@Test
public void testHasPrivilegesOnRepoJcrAll() throws Exception {
PermissionProvider pp = createPermissionProvider();
assertFalse(pp.hasPrivileges(null, JCR_ALL));
PermissionProvider ppo = createPermissionProviderOR();
assertFalse(ppo.hasPrivileges(null, JCR_ALL));
}
Aggregations