Search in sources :

Example 6 with AccessControlProvider

use of org.apache.jackrabbit.core.security.authorization.AccessControlProvider in project jackrabbit by apache.

the class SimpleSecurityManager method getAccessManager.

/**
     * @see JackrabbitSecurityManager#getAccessManager(Session,AMContext)
     */
public AccessManager getAccessManager(Session session, AMContext amContext) throws RepositoryException {
    checkInitialized();
    try {
        String wspName = session.getWorkspace().getName();
        AccessControlProvider acP = getAccessControlProvider(systemSession, wspName);
        AccessManagerConfig amc = config.getAccessManagerConfig();
        AccessManager accessMgr;
        if (amc == null) {
            accessMgr = new SimpleAccessManager();
        } else {
            accessMgr = amc.newInstance(AccessManager.class);
        }
        accessMgr.init(amContext, acP, workspaceAccessManager);
        return accessMgr;
    } catch (AccessDeniedException ade) {
        // re-throw
        throw ade;
    } catch (Exception e) {
        // wrap in RepositoryException
        String msg = "failed to instantiate AccessManager implementation: " + SimpleAccessManager.class.getName();
        log.error(msg, e);
        throw new RepositoryException(msg, e);
    }
}
Also used : WorkspaceAccessManager(org.apache.jackrabbit.core.security.authorization.WorkspaceAccessManager) AccessManager(org.apache.jackrabbit.core.security.AccessManager) AccessDeniedException(javax.jcr.AccessDeniedException) AccessManagerConfig(org.apache.jackrabbit.core.config.AccessManagerConfig) AccessControlProvider(org.apache.jackrabbit.core.security.authorization.AccessControlProvider) RepositoryException(javax.jcr.RepositoryException) AccessDeniedException(javax.jcr.AccessDeniedException) RepositoryException(javax.jcr.RepositoryException) UnsupportedRepositoryOperationException(javax.jcr.UnsupportedRepositoryOperationException)

Aggregations

AccessControlProvider (org.apache.jackrabbit.core.security.authorization.AccessControlProvider)6 RepositoryException (javax.jcr.RepositoryException)3 Principal (java.security.Principal)2 HashMap (java.util.HashMap)2 AccessDeniedException (javax.jcr.AccessDeniedException)2 ItemBasedPrincipal (org.apache.jackrabbit.api.security.principal.ItemBasedPrincipal)2 NodeImpl (org.apache.jackrabbit.core.NodeImpl)2 AccessManagerConfig (org.apache.jackrabbit.core.config.AccessManagerConfig)2 AccessManager (org.apache.jackrabbit.core.security.AccessManager)2 CompiledPermissions (org.apache.jackrabbit.core.security.authorization.CompiledPermissions)2 WorkspaceAccessManager (org.apache.jackrabbit.core.security.authorization.WorkspaceAccessManager)2 ArrayList (java.util.ArrayList)1 NoSuchWorkspaceException (javax.jcr.NoSuchWorkspaceException)1 UnsupportedRepositoryOperationException (javax.jcr.UnsupportedRepositoryOperationException)1 AccessControlException (javax.jcr.security.AccessControlException)1 WorkspaceConfig (org.apache.jackrabbit.core.config.WorkspaceConfig)1 WorkspaceSecurityConfig (org.apache.jackrabbit.core.config.WorkspaceSecurityConfig)1 DefaultAccessManager (org.apache.jackrabbit.core.security.DefaultAccessManager)1 AbstractAccessControlProvider (org.apache.jackrabbit.core.security.authorization.AbstractAccessControlProvider)1 AccessControlEditor (org.apache.jackrabbit.core.security.authorization.AccessControlEditor)1