org.modeshape.jcr

## Class AccessControlManagerImpl

- java.lang.Object
- - org.modeshape.jcr.AccessControlManagerImpl

- All Implemented Interfaces:
    AccessControlManager

      public class AccessControlManagerImpl
      extends Object
      implements AccessControlManager

  AccessControlManager implementation. AccessControlManager has been implemented suppose that node is associated with access control list which defines deny/allow actions for the given principal. Principals are transparent and can represent users or groups. ACLs are stored per node in a special child node called mode:acl. This node has a list of mode:{$principal_name} child nodes which has multi-value property permissions where permissions are defined by JCR specifications. {node} {mode:AccessControllable} +mode:acl{mode:Acl} +user-name{mode:permission} -permissions {String} To make node access controllable ModeShape adds "mode:AccessControllable" type to mixin types of the node. Access list related nodes are defined as protected do disallow normal add/remove/save item methods. Access list defined for the node also has affect on all child nodes unless child node defines its own Access list. Empty ACL means all permissions. Initially the default access list is assigned to the root node with all permissions granted to everyone. Access Control Manager implementation does not break any existing mechanism of authentications. It acts as an abstract secondary resource control feature. On the first stage one of the existing security acts and if it grants permission the ACL is asked to check permissions.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AccessControlManagerImpl(JcrSession session)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `AccessControlPolicyIterator` | `getApplicablePolicies(String absPath)`
    `AccessControlPolicy[]` | `getEffectivePolicies(String path)`
    `AccessControlPolicy[]` | `getPolicies(String absPath)`
    `Privilege[]` | `getPrivileges(String path)`
    `Privilege[]` | `getSupportedPrivileges(String path)`
    `protected boolean` | `hasPermission(Path absPath, String... actions)`
    `boolean` | `hasPrivileges(String path, Privilege[] privileges)`
    `Privilege` | `privilegeFromName(String name)`
    `Privilege[]` | `privileges()` Gets full list of known and supported privileges irrespective of the path.
    `void` | `removePolicy(String absPath, AccessControlPolicy policy)`
    `void` | `setPolicy(String absPath, AccessControlPolicy policy)`

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

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

- - ### Constructor Detail

    - #### AccessControlManagerImpl

          protected AccessControlManagerImpl(JcrSession session)

  - ### Method Detail

    - #### privileges

          public Privilege[] privileges()

      Gets full list of known and supported privileges irrespective of the path.
      Returns:
        list of privileges.

    - #### getSupportedPrivileges

          public Privilege[] getSupportedPrivileges(String path)

      Specified by:
        `getSupportedPrivileges` in interface `AccessControlManager`

    - #### privilegeFromName

          public Privilege privilegeFromName(String name)
                                      throws AccessControlException,
                                             RepositoryException

      Specified by:
        `privilegeFromName` in interface `AccessControlManager`
      Throws:
        `AccessControlException`
        `RepositoryException`

    - #### hasPrivileges

          public boolean hasPrivileges(String path,
                              Privilege[] privileges)
                                throws PathNotFoundException,
                                       RepositoryException

      Specified by:
        `hasPrivileges` in interface `AccessControlManager`
      Throws:
        `PathNotFoundException`
        `RepositoryException`

    - #### getPrivileges

          public Privilege[] getPrivileges(String path)
                                    throws PathNotFoundException,
                                           RepositoryException

      Specified by:
        `getPrivileges` in interface `AccessControlManager`
      Throws:
        `PathNotFoundException`
        `RepositoryException`

    - #### getPolicies

          public AccessControlPolicy[] getPolicies(String absPath)
                                            throws PathNotFoundException,
                                                   AccessDeniedException,
                                                   RepositoryException

      Specified by:
        `getPolicies` in interface `AccessControlManager`
      Throws:
        `PathNotFoundException`
        `AccessDeniedException`
        `RepositoryException`

    - #### getEffectivePolicies

          public AccessControlPolicy[] getEffectivePolicies(String path)
                                                     throws PathNotFoundException,
                                                            AccessDeniedException,
                                                            RepositoryException

      Specified by:
        `getEffectivePolicies` in interface `AccessControlManager`
      Throws:
        `PathNotFoundException`
        `AccessDeniedException`
        `RepositoryException`

    - #### getApplicablePolicies

          public AccessControlPolicyIterator getApplicablePolicies(String absPath)
                                                            throws PathNotFoundException,
                                                                   AccessDeniedException,
                                                                   RepositoryException

      Specified by:
        `getApplicablePolicies` in interface `AccessControlManager`
      Throws:
        `PathNotFoundException`
        `AccessDeniedException`
        `RepositoryException`

    - #### setPolicy

          public void setPolicy(String absPath,
                       AccessControlPolicy policy)
                         throws PathNotFoundException,
                                AccessControlException,
                                AccessDeniedException,
                                LockException,
                                VersionException,
                                RepositoryException

      Specified by:
        `setPolicy` in interface `AccessControlManager`
      Throws:
        `PathNotFoundException`
        `AccessControlException`
        `AccessDeniedException`
        `LockException`
        `VersionException`
        `RepositoryException`

    - #### removePolicy

          public void removePolicy(String absPath,
                          AccessControlPolicy policy)
                            throws PathNotFoundException,
                                   AccessControlException,
                                   AccessDeniedException,
                                   LockException,
                                   VersionException,
                                   RepositoryException

      Specified by:
        `removePolicy` in interface `AccessControlManager`
      Throws:
        `PathNotFoundException`
        `AccessControlException`
        `AccessDeniedException`
        `LockException`
        `VersionException`
        `RepositoryException`

    - #### hasPermission

          protected boolean hasPermission(Path absPath,
                              String... actions)

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.