Class CqActions

java.lang.Object
com.day.cq.security.util.CqActions

public class CqActions extends Object
Deprecated.
Please use Apache Jackrabbit privilege management and JCR access control management API instead.
This class defines the main CQ Actions and provides the mapping from and to JCR Privileges.
 "read"           Privilege.JCR_READ

 "modify"         Privilege.JCR_MODIFY_PROPERTIES,
                  Privilege.JCR_LOCK_MANAGEMENT,
                  Privilege.JCR_VERSION_MANAGEMENT

 "create"         Privilege.JCR_ADD_CHILD_NODES,
                  Privilege.JCR_NODE_TYPE_MANAGEMENT

 "delete"         Privilege.JCR_REMOVE_CHILD_NODES,
                  Privilege.JCR_REMOVE_NODE

 "acl_read"       Privilege.JCR_READ_ACCESS_CONTROL

 "acl_write"      Privilege.JCR_MODIFY_ACCESS_CONTROL

 "replicate"      "crx:replicate" (custom privilege)

 
See Also:
  • Field Details

    • ACTIONS

      public static final String[] ACTIONS
      Deprecated.
      CQ actions constants
  • Constructor Details

  • Method Details

    • getPrivileges

      public Set<Privilege> getPrivileges(String action)
      Deprecated.
      As of CQ 5.4 the mapping of CQ action to resulting ACEs/privileges depends on the nature of the target node.
      Returns the privileges that correspond to the given action string.
      Parameters:
      action - The action to be mapped.
      Returns:
      A set of privileges.
    • isGranted

      public boolean isGranted(Set<Privilege> privs, String action)
      Deprecated.
      As of CQ 5.4 the mapping of CQ action to privileges depends on the nature of the target node.
      Tests if the given action is granted by the given set of privileges.
      Parameters:
      privs - the privileges (on the node)
      action - the action to tested
      Returns:
      true if the action is allowed.
    • getActions

      public Collection<String> getActions(Session session, String path) throws RepositoryException
      Deprecated.
      Since 5.4
      Returns the names of the actions that are granted on the given path.
      Parameters:
      session - the session
      path - the path to check
      Returns:
      the set of actions that are granted.
      Throws:
      RepositoryException - if an error occurs
    • getAllowedActions

      public Collection<String> getAllowedActions(String nodePath, Set<Principal> principals) throws RepositoryException
      Deprecated.
      Parameters:
      nodePath -
      principals - The set of principals for which the action set needs to be evaluated. In case of a null value, this method will use the sessions's principals for evaluation
      Returns:
      the set of actions granted for the specified principals at the specified path.
      Throws:
      RepositoryException - If an error occurs.
      Since:
      5.4
    • installActions

      public void installActions(String nodePath, Principal principal, Map<String,Boolean> actionMap, Collection<String> inheritedAllows) throws RepositoryException
      Deprecated.
      Installs the specified actions for the given principal at the specified targetNode by converting it the corresponding JCR access control content.
      Parameters:
      nodePath -
      actionMap - A map of CQ Action name to a Boolean indicating whether the action should be granted or denied.
      inheritedAllows -
      Throws:
      RepositoryException - If an error occurs.
    • definesContent

      public static boolean definesContent(Node node) throws RepositoryException
      Deprecated.
      Returns true if the node is defined to have a jcr:content child node (that may or may not be present yet). Note that the test by intention does not rely on the existence of a jcr:content node that may as well be present with an unstructured or folder node.
      Parameters:
      node -
      Returns:
      true if the specified node is defined to possibly have a jcr:content child (such as e.g. nt:file, cq:Page and similar).
      Throws:
      RepositoryException
    • hasContentRestriction

      public static boolean hasContentRestriction(AccessControlEntry ace) throws RepositoryException
      Deprecated.
      Parameters:
      ace -
      Returns:
      Throws:
      RepositoryException