Search in sources :

Example 11 with RestrictionDefinition

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

the class AbstractAccessControlListTest method testGetRestrictionType.

@Test
public void testGetRestrictionType() throws RepositoryException {
    AbstractAccessControlList acl = createEmptyACL();
    for (RestrictionDefinition def : getRestrictionProvider().getSupportedRestrictions(getTestPath())) {
        int reqType = acl.getRestrictionType(getNamePathMapper().getJcrName(def.getName()));
        assertTrue(reqType > PropertyType.UNDEFINED);
        assertEquals(def.getRequiredType().tag(), reqType);
    }
}
Also used : RestrictionDefinition(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition) Test(org.junit.Test)

Aggregations

RestrictionDefinition (org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition)11 RestrictionDefinitionImpl (org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinitionImpl)5 Test (org.junit.Test)5 HashMap (java.util.HashMap)2 Nonnull (javax.annotation.Nonnull)2 AbstractAccessControlList (org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AbstractAccessControlList)2 HashSet (java.util.HashSet)1 Set (java.util.Set)1 Nullable (javax.annotation.Nullable)1 AccessControlException (javax.jcr.security.AccessControlException)1 Privilege (javax.jcr.security.Privilege)1 AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)1 Tree (org.apache.jackrabbit.oak.api.Tree)1 ValueFactoryImpl (org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl)1 ACE (org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.ACE)1 AbstractRestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.AbstractRestrictionProvider)1 Restriction (org.apache.jackrabbit.oak.spi.security.authorization.restriction.Restriction)1 Before (org.junit.Before)1