Class PrivilegesHelper
- java.lang.Object
-
- org.apache.sling.jcr.jackrabbit.accessmanager.impl.PrivilegesHelper
-
public abstract class PrivilegesHelper extends Object
Contains utility methods related to handling privileges
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<javax.jcr.security.Privilege,Set<javax.jcr.security.Privilege>>buildPrivilegeToAncestorMap(javax.jcr.Session jcrSession, String resourcePath)Builds a map of aggregate privileges to privileges they aggregatestatic voidmergePrivilegeSets(javax.jcr.security.Privilege privilege, Map<javax.jcr.security.Privilege,Set<javax.jcr.security.Privilege>> privilegeToAncestorMap, Set<javax.jcr.security.Privilege> add, Set<javax.jcr.security.Privilege> remove)Update the granted and denied privilege sets by merging the result of adding the supplied privilege.
-
-
-
Method Detail
-
buildPrivilegeToAncestorMap
public static Map<javax.jcr.security.Privilege,Set<javax.jcr.security.Privilege>> buildPrivilegeToAncestorMap(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryException
Builds a map of aggregate privileges to privileges they aggregate- Parameters:
jcrSession- a JCR sessionresourcePath- the path used to look up the supported privileges- Returns:
- a map, never
null - Throws:
javax.jcr.RepositoryException- error accessing the repository
-
mergePrivilegeSets
public static void mergePrivilegeSets(javax.jcr.security.Privilege privilege, Map<javax.jcr.security.Privilege,Set<javax.jcr.security.Privilege>> privilegeToAncestorMap, Set<javax.jcr.security.Privilege> add, Set<javax.jcr.security.Privilege> remove)Update the granted and denied privilege sets by merging the result of adding the supplied privilege.- Parameters:
privilege- the privilege to mergeprivilegeToAncestorMap- mapping created using buildPrivilegeToAncestorMap(Session, String)add- the first set to which the privilege should be added if missingremove- the second set from which the privilege should be removed if present
-
-