Class PrivilegesHelper


  • public abstract class PrivilegesHelper
    extends Object
    Contains utility methods related to handling privileges
    • 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 session
        resourcePath - 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 merge
        privilegeToAncestorMap - mapping created using buildPrivilegeToAncestorMap(Session, String)
        add - the first set to which the privilege should be added if missing
        remove - the second set from which the privilege should be removed if present