Class UIProjectUserGroupsService


  • @Component
    public class UIProjectUserGroupsService
    extends java.lang.Object
    UI Service to handle requests for project user groups.
    • Constructor Detail

      • UIProjectUserGroupsService

        public UIProjectUserGroupsService​(ProjectService projectService,
                                          UserGroupService userGroupService,
                                          org.springframework.context.MessageSource messageSource)
    • Method Detail

      • removeUserGroupFromProject

        public java.lang.String removeUserGroupFromProject​(long projectId,
                                                           long groupId,
                                                           java.util.Locale locale)
        Remove a UserGroup from a Project
        Parameters:
        projectId - Identifier for a Project
        groupId - Identifier for an UserGroup
        locale - current users Locale
        Returns:
        message to user about the result of removing the user group
      • getAvailableUserGroupsForProject

        public java.util.List<UserGroup> getAvailableUserGroupsForProject​(java.lang.Long projectId,
                                                                          java.lang.String query)
        Get a list of UserGroups that are not on the current Project
        Parameters:
        projectId - Identifier for the current Project
        query - Filter string to search the existing UserGroups by
        Returns:
        List of UserGroup
      • addUserGroupToProject

        public java.lang.String addUserGroupToProject​(java.lang.Long projectId,
                                                      NewMemberRequest request,
                                                      java.util.Locale locale)
        Add a UserGroup to the current Project
        Parameters:
        projectId - Identifier for a Project
        request - Identifier for an UserGroup
        locale - Current users Locale
        Returns:
        message to user about the outcome of adding the user group to the project
      • updateUserGroupMetadataRoleOnProject

        public java.lang.String updateUserGroupMetadataRoleOnProject​(java.lang.Long projectId,
                                                                     java.lang.Long groupId,
                                                                     java.lang.String metadataRole,
                                                                     java.util.Locale locale)
                                                              throws UIConstraintViolationException
        Update the ProjectMetadataRole of a UserGroup on the current Project
        Parameters:
        projectId - Identifier for a Project
        groupId - Identifier for an UserGroup
        metadataRole - metadata role to update for the group
        locale - Current users Locale
        Returns:
        message to user about the result of the update
        Throws:
        UIConstraintViolationException - if a project owners metadata role is set to anything other than the highest level