org.apache.sling.jcr.jackrabbit.server.impl.security

## Class PluggableDefaultAccessManager

- java.lang.Object
- - org.apache.jackrabbit.core.security.AbstractAccessControlManager
  - - org.apache.jackrabbit.core.security.DefaultAccessManager
    - - org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultAccessManager

All Implemented Interfaces:
  javax.jcr.security.AccessControlManager, org.apache.jackrabbit.api.security.JackrabbitAccessControlManager, org.apache.jackrabbit.core.security.AccessManager

    public class PluggableDefaultAccessManager
    extends org.apache.jackrabbit.core.security.DefaultAccessManager

Allows to plugin a custom `AccessManager` as an OSGi bundle:

1. Set this class as `AccessManager` in your `repository.xml`
2. Implement `o.a.s.j.j.s.s.a.AccessManagerPluginFactory`

If `PluggableDefaultAccessManager` is specified in `repository.xml`, and no implementation of `AccessManagerPluginFactory` exists, all calls will fall back to `DefaultAccessManager`.

See also SLING-880

See Also:
  `AccessManagerPluginFactory`

### Field Summary

Fields
`protected AccessManagerPluginFactory` `accessManagerFactory`
`protected AccessManagerFactoryTracker` `accessManagerFactoryTracker`

### Fields inherited from interface org.apache.jackrabbit.core.security.AccessManager

`READ, REMOVE, WRITE`

### Constructor Summary

Constructors
Constructor and Description
`PluggableDefaultAccessManager()`

### Method Summary

Methods
`boolean` `canAccess(String workspaceName)`
`boolean` `canRead(org.apache.jackrabbit.spi.Path itemPath, org.apache.jackrabbit.core.id.ItemId itemId)`
`void` `checkPermission(org.apache.jackrabbit.core.id.ItemId id, int permissions)`
`void` `close()`
`void` `endSession()`
`protected AccessManagerPluginFactory` `getAccessManagerFactory()`
`void` `init(org.apache.jackrabbit.core.security.AMContext context)`
`void` `init(org.apache.jackrabbit.core.security.AMContext context, org.apache.jackrabbit.core.security.authorization.AccessControlProvider acProvider, org.apache.jackrabbit.core.security.authorization.WorkspaceAccessManager wspAccessMgr)`
`boolean` `isGranted(org.apache.jackrabbit.core.id.ItemId id, int permissions)`
`boolean` `isGranted(org.apache.jackrabbit.spi.Path absPath, int permissions)`
`boolean` `isGranted(org.apache.jackrabbit.spi.Path parentPath, org.apache.jackrabbit.spi.Name childName, int permissions)`

### Methods inherited from class org.apache.jackrabbit.core.security.DefaultAccessManager

`checkInitialized, checkPermission, checkPermission, checkRepositoryPermission, checkValidNodePath, getApplicablePolicies, getApplicablePolicies, getEffectivePolicies, getEffectivePolicies, getPolicies, getPolicies, getPrivilegeManager, getPrivileges, getPrivileges, hasPrivileges, hasPrivileges, removePolicy, setPolicy`

### Methods inherited from class org.apache.jackrabbit.core.security.AbstractAccessControlManager

`getSupportedPrivileges, privilegeFromName`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### accessManagerFactory

    protected AccessManagerPluginFactory accessManagerFactory

#### accessManagerFactoryTracker

    protected AccessManagerFactoryTracker accessManagerFactoryTracker

### Constructor Detail

#### PluggableDefaultAccessManager

    public PluggableDefaultAccessManager()

### Method Detail

#### getAccessManagerFactory

    protected AccessManagerPluginFactory getAccessManagerFactory()

#### init

    public void init(org.apache.jackrabbit.core.security.AMContext context)
              throws javax.jcr.AccessDeniedException,
                     Exception

Specified by:
  `init` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `init` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `javax.jcr.AccessDeniedException`
  `Exception`

#### init

    public void init(org.apache.jackrabbit.core.security.AMContext context,
            org.apache.jackrabbit.core.security.authorization.AccessControlProvider acProvider,
            org.apache.jackrabbit.core.security.authorization.WorkspaceAccessManager wspAccessMgr)
              throws javax.jcr.AccessDeniedException,
                     Exception

Specified by:
  `init` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `init` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `javax.jcr.AccessDeniedException`
  `Exception`

#### close

    public void close()
               throws Exception

Specified by:
  `close` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `close` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `Exception`

#### endSession

    public void endSession()

#### checkPermission

    public void checkPermission(org.apache.jackrabbit.core.id.ItemId id,
                       int permissions)
                         throws javax.jcr.AccessDeniedException,
                                javax.jcr.ItemNotFoundException,
                                javax.jcr.RepositoryException

Specified by:
  `checkPermission` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `checkPermission` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `javax.jcr.AccessDeniedException`
  `javax.jcr.ItemNotFoundException`
  `javax.jcr.RepositoryException`

#### isGranted

    public boolean isGranted(org.apache.jackrabbit.core.id.ItemId id,
                    int permissions)
                      throws javax.jcr.ItemNotFoundException,
                             javax.jcr.RepositoryException

Specified by:
  `isGranted` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `isGranted` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `javax.jcr.ItemNotFoundException`
  `javax.jcr.RepositoryException`

#### isGranted

    public boolean isGranted(org.apache.jackrabbit.spi.Path absPath,
                    int permissions)
                      throws javax.jcr.RepositoryException

Specified by:
  `isGranted` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `isGranted` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `javax.jcr.RepositoryException`

#### isGranted

    public boolean isGranted(org.apache.jackrabbit.spi.Path parentPath,
                    org.apache.jackrabbit.spi.Name childName,
                    int permissions)
                      throws javax.jcr.RepositoryException

Specified by:
  `isGranted` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `isGranted` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `javax.jcr.RepositoryException`

#### canRead

    public boolean canRead(org.apache.jackrabbit.spi.Path itemPath,
                  org.apache.jackrabbit.core.id.ItemId itemId)
                    throws javax.jcr.RepositoryException

Specified by:
  `canRead` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `canRead` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `javax.jcr.RepositoryException`

#### canAccess

    public boolean canAccess(String workspaceName)
                      throws javax.jcr.RepositoryException

Specified by:
  `canAccess` in interface `org.apache.jackrabbit.core.security.AccessManager`
Overrides:
  `canAccess` in class `org.apache.jackrabbit.core.security.DefaultAccessManager`
Throws:
  `javax.jcr.RepositoryException`