Search in sources :

Example 21 with RestrictionProvider

use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider in project jackrabbit-oak by apache.

the class CompositeAuthorizationConfigurationTest method testMultipleWithEmptyRestrictionProvider.

@Test
public void testMultipleWithEmptyRestrictionProvider() {
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(createAuthorizationConfigurationImpl(), new OpenAuthorizationConfiguration() {

        @Nonnull
        @Override
        public RestrictionProvider getRestrictionProvider() {
            return RestrictionProvider.EMPTY;
        }
    });
    RestrictionProvider rp = cc.getRestrictionProvider();
    assertFalse(rp instanceof CompositeRestrictionProvider);
    assertNotSame(RestrictionProvider.EMPTY, rp);
}
Also used : Nonnull(javax.annotation.Nonnull) 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) OpenAuthorizationConfiguration(org.apache.jackrabbit.oak.spi.security.authorization.OpenAuthorizationConfiguration) AbstractSecurityTest(org.apache.jackrabbit.oak.AbstractSecurityTest) Test(org.junit.Test)

Example 22 with RestrictionProvider

use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider in project jackrabbit-oak by apache.

the class CompositeAuthorizationConfigurationTest method testMultipleRestrictionProvider.

@Test
public void testMultipleRestrictionProvider() {
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(createAuthorizationConfigurationImpl(), createAuthorizationConfigurationImpl());
    RestrictionProvider rp = cc.getRestrictionProvider();
    assertTrue(rp instanceof CompositeRestrictionProvider);
}
Also used : 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)

Aggregations

RestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider)22 Test (org.junit.Test)17 AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)12 CompositeRestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider)7 WhiteboardRestrictionProvider (org.apache.jackrabbit.oak.security.authorization.restriction.WhiteboardRestrictionProvider)6 SecurityProvider (org.apache.jackrabbit.oak.spi.security.SecurityProvider)6 AuthorizationConfiguration (org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration)6 AccessControlException (javax.jcr.security.AccessControlException)5 JackrabbitAccessControlList (org.apache.jackrabbit.api.security.JackrabbitAccessControlList)5 AuthorizationConfigurationImpl (org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl)5 ArrayList (java.util.ArrayList)4 CompositeAuthorizationConfiguration (org.apache.jackrabbit.oak.security.authorization.composite.CompositeAuthorizationConfiguration)4 AbstractRestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.AbstractRestrictionProvider)4 Nonnull (javax.annotation.Nonnull)2 PrivilegeManager (org.apache.jackrabbit.api.security.authorization.PrivilegeManager)2 Root (org.apache.jackrabbit.oak.api.Root)2 OpenAuthorizationConfiguration (org.apache.jackrabbit.oak.spi.security.authorization.OpenAuthorizationConfiguration)2 NodeUtil (org.apache.jackrabbit.oak.util.NodeUtil)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 Sets.newHashSet (com.google.common.collect.Sets.newHashSet)1