Package com.day.cq.security.util
Class CqActions
- java.lang.Object
-
- com.day.cq.security.util.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)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
ACTIONS
Deprecated.CQ actions constants
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
definesContent(Node node)
Deprecated.Returnstrue
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.4java.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.
-
-
-
Constructor Detail
-
CqActions
public CqActions(Session session) throws RepositoryException
Deprecated.- Throws:
RepositoryException
-
-
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 givenaction
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 givenaction
is granted by the given set of privileges.- Parameters:
action
- the action to testedprivs
- 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.4Returns the names of the actions that are granted on the given path.- Parameters:
path
- the path to checksession
- 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 anull
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.Returnstrue
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
-
-