Search in sources :

Example 1 with CompositeRestrictionProvider

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

the class CompositeAuthorizationConfigurationTest method testSingleRestrictionProvider.

@Test
public void testSingleRestrictionProvider() {
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(createAuthorizationConfigurationImpl());
    RestrictionProvider rp = cc.getRestrictionProvider();
    assertFalse(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)

Example 2 with CompositeRestrictionProvider

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

the class CompositeAuthorizationConfigurationTest method testOnlyEmptyRestrictionProvider.

@Test
public void testOnlyEmptyRestrictionProvider() {
    AuthorizationConfiguration ac = new OpenAuthorizationConfiguration() {

        @Nonnull
        @Override
        public RestrictionProvider getRestrictionProvider() {
            return RestrictionProvider.EMPTY;
        }
    };
    CompositeAuthorizationConfiguration cc = getCompositeConfiguration(ac, ac);
    RestrictionProvider rp = cc.getRestrictionProvider();
    assertFalse(rp instanceof CompositeRestrictionProvider);
    assertSame(RestrictionProvider.EMPTY, rp);
}
Also used : AuthorizationConfiguration(org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration) OpenAuthorizationConfiguration(org.apache.jackrabbit.oak.spi.security.authorization.OpenAuthorizationConfiguration) 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 3 with CompositeRestrictionProvider

use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider 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 4 with CompositeRestrictionProvider

use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider 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

AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)4 CompositeRestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider)4 RestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider)4 Test (org.junit.Test)4 OpenAuthorizationConfiguration (org.apache.jackrabbit.oak.spi.security.authorization.OpenAuthorizationConfiguration)2 Nonnull (javax.annotation.Nonnull)1 AuthorizationConfiguration (org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration)1