Search in sources :

Example 6 with RepositoryPermission

use of org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission in project jackrabbit-oak by apache.

the class CompositeProviderFullScopeTest method testRepositoryPermissionIsGrantedAdminUser.

@Test
public void testRepositoryPermissionIsGrantedAdminUser() throws Exception {
    RepositoryPermission rp = cppAdminUser.getRepositoryPermission();
    assertTrue(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT | Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.PRIVILEGE_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT | Permissions.PRIVILEGE_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.ALL));
}
Also used : RepositoryPermission(org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission) Test(org.junit.Test)

Example 7 with RepositoryPermission

use of org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission in project jackrabbit-oak by apache.

the class CompositeProviderCoverageTest method testRepositoryPermissionsIsGranted.

@Test
public void testRepositoryPermissionsIsGranted() throws Exception {
    RepositoryPermission rp = cpp.getRepositoryPermission();
    assertTrue(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.ALL));
}
Also used : RepositoryPermission(org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission) Test(org.junit.Test)

Example 8 with RepositoryPermission

use of org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission in project jackrabbit-oak by apache.

the class CompositeProviderFullScopeTest method testRepositoryPermissionIsGranted.

@Test
public void testRepositoryPermissionIsGranted() throws Exception {
    RepositoryPermission rp = cppTestUser.getRepositoryPermission();
    assertTrue(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
    assertFalse(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT | Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
}
Also used : RepositoryPermission(org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission) Test(org.junit.Test)

Example 9 with RepositoryPermission

use of org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission in project jackrabbit-oak by apache.

the class CompositeProviderNoScopeTest method testRepositoryPermissionIsGrantedAdminUser.

@Test
public void testRepositoryPermissionIsGrantedAdminUser() throws Exception {
    RepositoryPermission rp = cppAdminUser.getRepositoryPermission();
    assertTrue(rp.isGranted(Permissions.ALL));
}
Also used : RepositoryPermission(org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission) Test(org.junit.Test)

Example 10 with RepositoryPermission

use of org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission in project jackrabbit-oak by apache.

the class CompositeProviderNoScopeTest method testRepositoryPermissionIsGranted.

@Test
public void testRepositoryPermissionIsGranted() throws Exception {
    RepositoryPermission rp = cppTestUser.getRepositoryPermission();
    assertTrue(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT));
    assertTrue(rp.isGranted(Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
    assertTrue(rp.isGranted(Permissions.NAMESPACE_MANAGEMENT | Permissions.NODE_TYPE_DEFINITION_MANAGEMENT));
}
Also used : RepositoryPermission(org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission) Test(org.junit.Test)

Aggregations

RepositoryPermission (org.apache.jackrabbit.oak.spi.security.authorization.permission.RepositoryPermission)12 Test (org.junit.Test)12 AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)3 ContentSession (org.apache.jackrabbit.oak.api.ContentSession)1 Tree (org.apache.jackrabbit.oak.api.Tree)1 PermissionProvider (org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider)1