Class BaseRightProfile

    • Constructor Detail

      • BaseRightProfile

        public BaseRightProfile()
        Creates an empty profile of rights access.
      • BaseRightProfile

        public BaseRightProfile​(BaseRightProfile profile)
        Creates a profile as a copy of the specified one. The identifier isn't copied as it should be unique.
        Parameters:
        profile - the rights profile to copy.
    • Method Detail

      • setId

        public void setId​(String sId)
        Sets a unique identifier to this profile. Shouldn't be used. Reserved to the persistence layer.
        Parameters:
        sId - the unique identifier of the profile.
      • getId

        public String getId()
        Gets a unique identifier of this profile.
        Returns:
        the profile identifier.
      • setName

        public void setName​(String sName)
        Sets a name to this profile. The name of the profile defines by convention the privileges that are granted to the users and groups defined in this profile. In Silverpeas, the privileges are defined by convention in different predefined roles and it is the name of this role that should be set here.
        Parameters:
        sName - the name of the role referred by this profile.
      • getName

        public String getName()
        Gets the name of this profile. The name of the profile defines by convention the privileges that are granted to the users and groups defined in this profile. In Silverpeas, the privileges are defined by convention in different predefined roles and it is the name of this role that is returned here.
        Returns:
        the name of the role referred by this profile.
      • setLabel

        public void setLabel​(String sLabel)
        Sets a label to this profile. A label is a user-friendly name given to this profile.
        Parameters:
        sLabel - a label to give to this profile.
      • getLabel

        public String getLabel()
        Gets a label of this profile. A label is a user-friendly name given to this profile.
        Returns:
        the profile label.
      • setDescription

        public void setDescription​(String sDescription)
        Sets a short description to this profile
        Parameters:
        sDescription - a textual description.
      • getDescription

        public String getDescription()
        Gets a short description of this profile.
        Returns:
        a profile description.
      • isInherited

        public boolean isInherited()
        Is the right accesses defined by this profile are inherited by another right profile, a parent right profile?
        Returns:
        true if the right accesses are inherited. False otherwise.
      • setInherited

        public void setInherited​(boolean isInherited)
        Sets the inheritance in right accesses to this profile.
        Parameters:
        isInherited - a boolean indicating if the right accesses are inherited from another right profile.
      • getNumGroup

        public int getNumGroup()
        Gets the number of groups that are concerned by this profile
        Returns:
      • addGroup

        public void addGroup​(String sGroupId)
        Adds among the groups covered by this profile the specified group.
        Specified by:
        addGroup in interface RightProfile
        Parameters:
        sGroupId - the unique identifier of a group.
      • removeGroup

        public void removeGroup​(String sGroupId)
        Removes from the groups concerned by this profile the specified group.
        Specified by:
        removeGroup in interface RightProfile
        Parameters:
        sGroupId - the unique identifier of a group.
      • getAllGroups

        public List<String> getAllGroups()
        Gets all the groups that are concerned by this profile.
        Specified by:
        getAllGroups in interface RightProfile
        Returns:
        a list of group identifiers.
      • removeAllGroups

        public void removeAllGroups()
        Removes all the groups concerned by this profile.
      • getNumUser

        public int getNumUser()
        Gets the number of users covered by this profile.
        Returns:
        the number of users in this profile.
      • addUser

        public void addUser​(String sUserId)
        Adds a user as being covered by this profile.
        Specified by:
        addUser in interface RightProfile
        Parameters:
        sUserId - a unique identifier of a user.
      • removeUser

        public void removeUser​(String sUserId)
        Removes the specified user among those covered by this profile.
        Specified by:
        removeUser in interface RightProfile
        Parameters:
        sUserId - a unique identifier of a user.
      • getAllUsers

        public List<String> getAllUsers()
        Gets all the users concerned by this profile.
        Specified by:
        getAllUsers in interface RightProfile
        Returns:
        a list of user identifiers.
      • removeAllUsers

        public void removeAllUsers()
        Removes all the users concerned by this profile.
      • addUsers

        public void addUsers​(List<String> users)
        Adds all the specified users in this profile.
        Parameters:
        users - a list of user identifiers.
      • addGroups

        public void addGroups​(List<String> groups)
        Adds all the specified groups in this profile.
        Parameters:
        groups - a list of group identifiers.
      • setUsers

        public void setUsers​(List<String> users)
      • setGroups

        public void setGroups​(List<String> groups)
      • isEmpty

        public boolean isEmpty()
        Is this right profile empty?
        Returns:
        true if no users or groups are concerned by this right profile. False otherwise.