Search in sources :

Example 6 with AuthorizationConfigurationImpl

use of org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl in project jackrabbit-oak by apache.

the class CompositeAuthorizationConfigurationTest method testSingleRestrictionProvider.

@Test
public void testSingleRestrictionProvider() {
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(new AuthorizationConfigurationImpl(getSecurityProvider()));
    RestrictionProvider rp = cc.getRestrictionProvider();
    assertFalse(rp instanceof CompositeRestrictionProvider);
}
Also used : AuthorizationConfigurationImpl(org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl) RestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider) CompositeRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider) CompositeRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider) AbstractSecurityTest(org.apache.jackrabbit.oak.AbstractSecurityTest) Test(org.junit.Test)

Example 7 with AuthorizationConfigurationImpl

use of org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl in project jackrabbit-oak by apache.

the class CompositeAuthorizationConfigurationTest method testMultipleGetAccessControlManager.

@Test
public void testMultipleGetAccessControlManager() throws RepositoryException {
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(new AuthorizationConfigurationImpl(getSecurityProvider()), new AuthorizationConfigurationImpl(getSecurityProvider()));
    AccessControlManager accessControlManager = cc.getAccessControlManager(root, NamePathMapper.DEFAULT);
    assertTrue(accessControlManager instanceof CompositeAccessControlManager);
}
Also used : AccessControlManager(javax.jcr.security.AccessControlManager) AuthorizationConfigurationImpl(org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl) AbstractSecurityTest(org.apache.jackrabbit.oak.AbstractSecurityTest) Test(org.junit.Test)

Example 8 with AuthorizationConfigurationImpl

use of org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl in project jackrabbit-oak by apache.

the class CompositeAuthorizationConfigurationTest method testMultipleRestrictionProvider.

@Test
public void testMultipleRestrictionProvider() {
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(new AuthorizationConfigurationImpl(getSecurityProvider()), new AuthorizationConfigurationImpl(getSecurityProvider()));
    RestrictionProvider rp = cc.getRestrictionProvider();
    assertTrue(rp instanceof CompositeRestrictionProvider);
}
Also used : AuthorizationConfigurationImpl(org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl) RestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider) CompositeRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider) CompositeRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider) AbstractSecurityTest(org.apache.jackrabbit.oak.AbstractSecurityTest) Test(org.junit.Test)

Example 9 with AuthorizationConfigurationImpl

use of org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl in project jackrabbit-oak by apache.

the class CompositeAuthorizationConfigurationTest method testSingleGetPermissionProvider.

@Test
public void testSingleGetPermissionProvider() {
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(new AuthorizationConfigurationImpl(getSecurityProvider()));
    PermissionProvider pp = cc.getPermissionProvider(root, root.getContentSession().getWorkspaceName(), Collections.<Principal>emptySet());
    assertFalse(pp instanceof CompositePermissionProvider);
}
Also used : AuthorizationConfigurationImpl(org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl) EmptyPermissionProvider(org.apache.jackrabbit.oak.spi.security.authorization.permission.EmptyPermissionProvider) PermissionProvider(org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider) AbstractSecurityTest(org.apache.jackrabbit.oak.AbstractSecurityTest) Test(org.junit.Test)

Example 10 with AuthorizationConfigurationImpl

use of org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl in project jackrabbit-oak by apache.

the class CompositeAuthorizationConfigurationTest method testMultipleGetPermissionProvider.

@Test
public void testMultipleGetPermissionProvider() {
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(new OpenAuthorizationConfiguration(), new AuthorizationConfigurationImpl(getSecurityProvider()));
    PermissionProvider pp = cc.getPermissionProvider(root, root.getContentSession().getWorkspaceName(), Collections.<Principal>emptySet());
    assertFalse(pp instanceof CompositePermissionProvider);
}
Also used : AuthorizationConfigurationImpl(org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl) EmptyPermissionProvider(org.apache.jackrabbit.oak.spi.security.authorization.permission.EmptyPermissionProvider) PermissionProvider(org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider) OpenAuthorizationConfiguration(org.apache.jackrabbit.oak.spi.security.authorization.OpenAuthorizationConfiguration) AbstractSecurityTest(org.apache.jackrabbit.oak.AbstractSecurityTest) Test(org.junit.Test)

Aggregations

AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)14 AuthorizationConfigurationImpl (org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl)14 Test (org.junit.Test)14 RestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider)7 CompositeAuthorizationConfiguration (org.apache.jackrabbit.oak.security.authorization.composite.CompositeAuthorizationConfiguration)4 WhiteboardRestrictionProvider (org.apache.jackrabbit.oak.security.authorization.restriction.WhiteboardRestrictionProvider)4 SecurityProvider (org.apache.jackrabbit.oak.spi.security.SecurityProvider)4 AuthorizationConfiguration (org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration)4 EmptyPermissionProvider (org.apache.jackrabbit.oak.spi.security.authorization.permission.EmptyPermissionProvider)3 PermissionProvider (org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider)3 CompositeRestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider)3 Field (java.lang.reflect.Field)2 AccessControlManager (javax.jcr.security.AccessControlManager)2 OpenAuthorizationConfiguration (org.apache.jackrabbit.oak.spi.security.authorization.OpenAuthorizationConfiguration)2 Nonnull (javax.annotation.Nonnull)1 Tree (org.apache.jackrabbit.oak.api.Tree)1 Context (org.apache.jackrabbit.oak.spi.security.Context)1 OsgiContext (org.apache.sling.testing.mock.osgi.junit.OsgiContext)1