use of org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission in project jackrabbit-oak by apache.
the class CompositeProviderScopeTest method testRepositoryPermissionIsGranted.
@Test
public void testRepositoryPermissionIsGranted() throws Exception {
RepositoryPermission rp = cppTestUser.getRepositoryPermission();
assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT));
assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT | Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT | Permissions.PRIVILEGE_MANAGEMENT));
assertTrue(rp.isGranted(Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
assertFalse(rp.isGranted(Permissions.PRIVILEGE_MANAGEMENT));
assertFalse(rp.isGranted(Permissions.NODE_TYPE_DEFINITION_MANAGEMENT | Permissions.PRIVILEGE_MANAGEMENT | Permissions.WORKSPACE_MANAGEMENT));
assertFalse(rp.isGranted(Permissions.ALL));
}
use of org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission in project jackrabbit-oak by apache.
the class CompositeProviderScopeTest method testRepositoryPermissionIsGrantedAdmin.
@Test
public void testRepositoryPermissionIsGrantedAdmin() throws Exception {
RepositoryPermission rp = cppAdminUser.getRepositoryPermission();
assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT));
assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT | Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT | Permissions.PRIVILEGE_MANAGEMENT));
assertTrue(rp.isGranted(Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
assertTrue(rp.isGranted(Permissions.PRIVILEGE_MANAGEMENT));
assertTrue(rp.isGranted(Permissions.NODE_TYPE_DEFINITION_MANAGEMENT | Permissions.PRIVILEGE_MANAGEMENT | Permissions.WORKSPACE_MANAGEMENT));
assertFalse(rp.isGranted(Permissions.ALL));
}
Aggregations