Class RightProfilesDAO

    • Method Detail

      • clearCache

        public void clearCache()
        Clear the profiles cache
      • getProfiles

        public List<ProfilegetProfiles​(String context)
        Get the profiles on a given context
        Parameters:
        context - The context. Can be null. If null, the profiles with no context are returned.
        Returns:
        The list for profiles for this context
      • getProfile

        public Profile getProfile​(String id)
        Get the profile with given identifier
        Parameters:
        id - The id of profile to retrieve
        Returns:
        The profile
      • getProfilesWithRight

        public Set<StringgetProfilesWithRight​(String rightId)
        Get all profiles containing the right with given id
        Parameters:
        rightId - The id of right
        Returns:
        The id of profiles with this right
      • addProfile

        public Profile addProfile​(String label)
        Creates a new profile with null context. The identifier of the profile will be automatically generated from label.
        Parameters:
        label - The label of profile
        Returns:
        The create profile
      • addProfile

        public Profile addProfile​(String label,
                                  String context)
        Creates a new profile. The identifier of the profile will be automatically generated from label.
        Parameters:
        label - The label of profile
        context - The context. Can be null
        Returns:
        The create profile
      • addProfile

        public Profile addProfile​(String id,
                                  String label,
                                  String context)
        Creates a new profile
        Parameters:
        id - The unique identifier of profile
        label - The label of profile
        context - The context. Can be null
        Returns:
        The create profile
      • addProfile

        public void addProfile​(Profile profile,
                               boolean silent)
        Add a new profile
        Parameters:
        profile - The profile to add
        silent - Set to true to not notify observer of this update
      • addProfile

        public void addProfile​(Profile profile)
        Add a new profile
        Parameters:
        profile - The profile to add
      • renameProfile

        public void renameProfile​(Profile profile,
                                  String newLabel)
        Rename a profile
        Parameters:
        profile - The profile to rename
        newLabel - The updated label
      • renameProfile

        public void renameProfile​(Profile profile,
                                  String newLabel,
                                  boolean silent)
        Rename a profile
        Parameters:
        profile - The profile to rename
        newLabel - The updated label
        silent - Set to true to not notify observer of this update
      • getRights

        public List<StringgetRights​(String profileId)
        Get the rights of a profile
        Parameters:
        profileId - The profile id
        Returns:
        The rights
      • getRights

        public List<StringgetRights​(Profile profile)
        Get the rights of a profile
        Parameters:
        profile - The profile
        Returns:
        The rights
      • addRight

        public void addRight​(Profile profile,
                             String rightId)
        Add a right to a profile
        Parameters:
        profile - The profile
        rightId - The id of right to add
      • addRights

        public void addRights​(Profile profile,
                              List<String> rightIds)
        Add a right to a profile
        Parameters:
        profile - The profile
        rightIds - The id of rights to add
      • updateRights

        public void updateRights​(Profile profile,
                                 List<String> rights)
        Update the rights of a profile
        Parameters:
        profile - The profile
        rights - The rights of the profile
      • updateRights

        public void updateRights​(Profile profile,
                                 List<String> rights,
                                 boolean silent)
        Update the rights of a profile
        Parameters:
        profile - The profile
        rights - The rights of the profile
        silent - Set to true to not notify observer of this update
      • _addRight

        private void _addRight​(org.apache.ibatis.session.SqlSession session,
                               Profile profile,
                               String rightId)
      • removeRights

        public void removeRights​(Profile profile)
        Add a right to a profile
        Parameters:
        profile - The profile
      • removeRights

        public void removeRights​(Profile profile,
                                 boolean silent)
        Add a right to a profile
        Parameters:
        profile - The profile
        silent - Set to true to not notify observer of this update
      • deleteProfile

        public void deleteProfile​(Profile profile)
        Delete a profile
        Parameters:
        profile - The profile to delete
      • deleteProfile

        public void deleteProfile​(Profile profile,
                                  boolean silent)
        Delete a profile
        Parameters:
        profile - The profile to delete
        silent - Set to true to not notify observer of this update