Class AuthorizablePrivilegesInfoImpl

  • All Implemented Interfaces:
    AuthorizablePrivilegesInfo

    public class AuthorizablePrivilegesInfoImpl
    extends Object
    implements AuthorizablePrivilegesInfo
    Helper class to assist in the usage of access control of users/groups from scripts. The default access control policy defined by this provider has the following characteristics:
    • everybody has READ permission to all items,
    • every known user is allowed to modify it's own properties except for her/his group membership,
    • Constructor Detail

      • AuthorizablePrivilegesInfoImpl

        public AuthorizablePrivilegesInfoImpl()
    • Method Detail

      • canAddGroup

        public boolean canAddGroup​(javax.jcr.Session jcrSession)
        Description copied from interface: AuthorizablePrivilegesInfo
        Checks whether the current user has been granted privileges to add a new group.
        Specified by:
        canAddGroup in interface AuthorizablePrivilegesInfo
        Parameters:
        jcrSession - the JCR session of the current user
        Returns:
        true if the current user has the privileges, false otherwise
      • canAddUser

        public boolean canAddUser​(javax.jcr.Session jcrSession)
        Description copied from interface: AuthorizablePrivilegesInfo
        Checks whether the current user has been granted privileges to add a new user.
        Specified by:
        canAddUser in interface AuthorizablePrivilegesInfo
        Parameters:
        jcrSession - the JCR session of the current user
        Returns:
        true if the current user has the privileges, false otherwise
      • canRemove

        public boolean canRemove​(javax.jcr.Session jcrSession,
                                 String principalId)
        Description copied from interface: AuthorizablePrivilegesInfo
        Checks whether the current user has been granted privileges to remove the specified user or group.
        Specified by:
        canRemove in interface AuthorizablePrivilegesInfo
        Parameters:
        jcrSession - the JCR session of the current user
        principalId - the user or group id to check
        Returns:
        true if the current user has the privileges, false otherwise
      • canUpdateGroupMembers

        public boolean canUpdateGroupMembers​(javax.jcr.Session jcrSession,
                                             String groupId)
        Description copied from interface: AuthorizablePrivilegesInfo
        Checks whether the current user has been granted privileges to update the membership of the specified group.
        Specified by:
        canUpdateGroupMembers in interface AuthorizablePrivilegesInfo
        Parameters:
        jcrSession - the JCR session of the current user
        groupId - the group id to check
        Returns:
        true if the current user has the privileges, false otherwise
      • canUpdateProperties

        public boolean canUpdateProperties​(javax.jcr.Session jcrSession,
                                           String principalId)
        Description copied from interface: AuthorizablePrivilegesInfo
        Checks whether the current user has been granted privileges to update the properties of the specified user or group. Equivalent of: #canUpdateProperties(Session, String, PropertyUpdateTypes.addProperty, PropertyUpdateTypes.addNestedProperty, PropertyUpdateTypes.alterProperty, PropertyUpdateTypes.removeProperty)
        Specified by:
        canUpdateProperties in interface AuthorizablePrivilegesInfo
        Parameters:
        jcrSession - the JCR session of the current user
        principalId - the user or group id to check
        Returns:
        true if the current user has the privileges, false otherwise
      • canDisable

        public boolean canDisable​(javax.jcr.Session jcrSession,
                                  String userId)
        Description copied from interface: AuthorizablePrivilegesInfo
        Checks whether the current user has been granted privileges to disable the specified user.
        Specified by:
        canDisable in interface AuthorizablePrivilegesInfo
        Parameters:
        jcrSession - the JCR session of the current user
        userId - the user id to check
        Returns:
        true if the current user has the privileges, false otherwise
      • canChangePassword

        public boolean canChangePassword​(javax.jcr.Session jcrSession,
                                         String userId)
        Description copied from interface: AuthorizablePrivilegesInfo
        Checks whether the current user has been granted privileges to change the password of the specified user.
        Specified by:
        canChangePassword in interface AuthorizablePrivilegesInfo
        Parameters:
        jcrSession - the JCR session of the current user
        userId - the user id to check
        Returns:
        true if the current user has the privileges, false otherwise