Search in sources :

Example 11 with AbstractAccessControlList

use of org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AbstractAccessControlList in project jackrabbit-oak by apache.

the class ACLTest method testGetRestrictionType.

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

Aggregations

AbstractAccessControlList (org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AbstractAccessControlList)11 Test (org.junit.Test)11 HashMap (java.util.HashMap)2 AccessControlEntry (javax.jcr.security.AccessControlEntry)2 Privilege (javax.jcr.security.Privilege)2 JackrabbitAccessControlEntry (org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry)2 LocalNameMapper (org.apache.jackrabbit.oak.namepath.LocalNameMapper)2 NamePathMapper (org.apache.jackrabbit.oak.namepath.NamePathMapper)2 NamePathMapperImpl (org.apache.jackrabbit.oak.namepath.NamePathMapperImpl)2 RestrictionDefinition (org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition)2 GlobalNameMapper (org.apache.jackrabbit.oak.namepath.GlobalNameMapper)1 NameMapper (org.apache.jackrabbit.oak.namepath.NameMapper)1 ACE (org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.ACE)1