Interface SUserGroup

    • Method Detail

      • setName

        void setName​(@NotNull
                     String name)
              throws UserGroupException
        Sets the group name.

        Note: group name must be unique among all user groups. If name already exists, an exception is thrown.

        The name cannot be empty and cannot exceed 255 characters.

        Parameters:
        name - the new group name
        Throws:
        UserGroupException - if name already exists, or is empty, or is too long
        See Also:
        UserGroup.getName()
      • addSubgroup

        void addSubgroup​(@NotNull
                         UserGroup group)
                  throws UserGroupException
        Adds a subgroup to this group. Does nothing if the subgroup is already included directly.

        User group cycles by inclusion are not permitted. An attempt to create a cycle results in exception.

        Parameters:
        group - a subgroup to add
        Throws:
        UserGroupException - if addition of the subgroup leads to a cycle
      • removeSubgroup

        void removeSubgroup​(@NotNull
                            UserGroup group)
        Removes a direct subgroup. Does nothing if the subgroup is included indirectly.
        Parameters:
        group - a subgroup to remove
      • addUser

        void addUser​(@NotNull
                     User user)
        Adds a user to this group. Does nothing if the user is already included into this group directly.
        Parameters:
        user - the user to add
      • removeUser

        void removeUser​(@NotNull
                        User user)
                 throws UserGroupException
        Removes a user from this group. Does nothing if the user is not included into this group directly.

        The user isn't allowed to remove himself from any group.

        Parameters:
        user - a user to remove
        Throws:
        UserGroupException - if user is the authority holder, trying to remove himself
      • setGroupProperties

        void setGroupProperties​(@NotNull
                                Map<? extends PropertyKey,​String> properties)
                         throws UserGroupException
        Updates properties of this group. Only those properties will be updated which keys are specified in the properties map. All other properties will be left intact.
        Parameters:
        properties - properties
        Throws:
        UserGroupException - if specified group no longer exists
      • setGroupProperty

        void setGroupProperty​(@NotNull
                              PropertyKey propertyKey,
                              String value)
                       throws UserGroupException
        Sets a property with specified key and value in this group.
        Parameters:
        propertyKey - property key
        value - value of the property
        Throws:
        UserGroupException - if specified group no longer exists
      • deleteGroupProperty

        void deleteGroupProperty​(@NotNull
                                 PropertyKey propertyKey)
                          throws UserGroupException
        Deletes a property with specified key from this group.
        Parameters:
        propertyKey - property key
        Throws:
        UserGroupException - if specified group no longer exists