Class CqActions


  • public class CqActions
    extends java.lang.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:
    PrivilegeManager.registerPrivilege(String, boolean, String[]), AccessControlManager.getPrivileges(String)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] ACTIONS
      Deprecated.
      CQ actions constants
    • Constructor Summary

      Constructors 
      Constructor Description
      CqActions​(Session session)
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static boolean definesContent​(Node node)
      Deprecated.
      Returns true if the node is defined to have a jcr:content child node (that may or may not be present yet).
      java.util.Collection<java.lang.String> getActions​(Session session, java.lang.String path)
      Deprecated.
      Since 5.4
      java.util.Collection<java.lang.String> getAllowedActions​(java.lang.String nodePath, java.util.Set<java.security.Principal> principals)
      Deprecated.
       
      java.util.Set<Privilege> getPrivileges​(java.lang.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.
      static boolean hasContentRestriction​(AccessControlEntry ace)
      Deprecated.
       
      void installActions​(java.lang.String nodePath, java.security.Principal principal, java.util.Map<java.lang.String,​java.lang.Boolean> actionMap, java.util.Collection<java.lang.String> inheritedAllows)
      Deprecated.
      Installs the specified actions for the given principal at the specified targetNode by converting it the corresponding JCR access control content.
      boolean isGranted​(java.util.Set<Privilege> privs, java.lang.String action)
      Deprecated.
      As of CQ 5.4 the mapping of CQ action to privileges depends on the nature of the target node.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ACTIONS

        public static final java.lang.String[] ACTIONS
        Deprecated.
        CQ actions constants
    • Method Detail

      • getPrivileges

        public java.util.Set<Privilege> getPrivileges​(java.lang.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​(java.util.Set<Privilege> privs,
                                 java.lang.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:
        action - the action to tested
        privs - the privileges (on the node)
        Returns:
        true if the action is allowed.
      • getActions

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

        public java.util.Collection<java.lang.String> getAllowedActions​(java.lang.String nodePath,
                                                                        java.util.Set<java.security.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​(java.lang.String nodePath,
                                   java.security.Principal principal,
                                   java.util.Map<java.lang.String,​java.lang.Boolean> actionMap,
                                   java.util.Collection<java.lang.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