Search in sources :

Example 1 with PolicyOwner

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

the class CompositeAccessControlManager method getApplicablePolicies.

//-------------------------------------< JackrabbitAccessControlManager >---
@Override
public JackrabbitAccessControlPolicy[] getApplicablePolicies(Principal principal) throws RepositoryException {
    ImmutableList.Builder<JackrabbitAccessControlPolicy> policies = ImmutableList.builder();
    for (AccessControlManager acMgr : acMgrs) {
        if (acMgr instanceof JackrabbitAccessControlManager && acMgr instanceof PolicyOwner) {
            policies.add(((JackrabbitAccessControlManager) acMgr).getApplicablePolicies(principal));
        }
    }
    List<JackrabbitAccessControlPolicy> l = policies.build();
    return l.toArray(new JackrabbitAccessControlPolicy[l.size()]);
}
Also used : AbstractAccessControlManager(org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AbstractAccessControlManager) AccessControlManager(javax.jcr.security.AccessControlManager) JackrabbitAccessControlManager(org.apache.jackrabbit.api.security.JackrabbitAccessControlManager) JackrabbitAccessControlManager(org.apache.jackrabbit.api.security.JackrabbitAccessControlManager) ImmutableList(com.google.common.collect.ImmutableList) JackrabbitAccessControlPolicy(org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy) PolicyOwner(org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.PolicyOwner)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 AccessControlManager (javax.jcr.security.AccessControlManager)1 JackrabbitAccessControlManager (org.apache.jackrabbit.api.security.JackrabbitAccessControlManager)1 JackrabbitAccessControlPolicy (org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy)1 AbstractAccessControlManager (org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AbstractAccessControlManager)1 PolicyOwner (org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.PolicyOwner)1