Interface RoleService

    • Method Detail

      • addUserRole

        ActionResponse addUserRole​(String userId,
                                   String roleId)
        Adds a global role to a user
        Parameters:
        userId - the user id
        roleId - the role id to add
        Returns:
        the action response
      • addUserRole

        ActionResponse addUserRole​(String tenantId,
                                   String userId,
                                   String roleId)
        Adds a tenant based role to a user
        Parameters:
        tenantId - the tenant id
        userId - the user id
        roleId - the role id
        Returns:
        the action response
      • removeUserRole

        ActionResponse removeUserRole​(String userId,
                                      String roleId)
        Removes a global role from a user
        Parameters:
        userId - the user id
        roleId - the role id
        Returns:
        the action response
      • removeUserRole

        ActionResponse removeUserRole​(String tenantId,
                                      String userId,
                                      String roleId)
        Removes the user role from a user and the associated tenant
        Parameters:
        tenantId - the tenant id
        userId - the user id
        roleId - the role id
        Returns:
        the action response
      • list

        List<? extends Role> list()
        Lists the global roles
        Returns:
        the list
      • listRolesForUser

        List<? extends Role> listRolesForUser​(String userId)
        List roles for user.
        Parameters:
        userId - the user id
        Returns:
        the list
      • listRolesForUser

        List<? extends Role> listRolesForUser​(String userId,
                                              String tenantId)
        List roles for user.
        Parameters:
        userId - the user id
        tenantId - the tenant id
        Returns:
        the list
      • delete

        ActionResponse delete​(String roleId)
        Delete a role by it's ID
        Parameters:
        roleId - the role id
        the - action response
      • get

        Role get​(String roleId)
        Gets a role by ID
        Parameters:
        roleId - the role id
        Returns:
        the role
      • getByName

        Role getByName​(String name)
        Gets a Role by Name
        Parameters:
        name - the name of the Role
        Returns:
        the Role or null if not found
      • create

        Role create​(String name)
        Creates a new Role
        Parameters:
        name - the name of the role
        Returns:
        the role