Class RoleServiceImpl

    • Constructor Detail

      • RoleServiceImpl

        public RoleServiceImpl()
    • Method Detail

      • addUserRole

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

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

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

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

        public List<? extends Role> list()
        Lists the global roles
        Specified by:
        list in interface RoleService
        Returns:
        the list
      • listRolesForUser

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

        public List<? extends Role> listRolesForUser​(String userId,
                                                     String tenantId)
        List roles for user.
        Specified by:
        listRolesForUser in interface RoleService
        Parameters:
        userId - the user id
        tenantId - the tenant id
        Returns:
        the list
      • get

        public Role get​(String roleId)
        Gets a role by ID
        Specified by:
        get in interface RoleService
        Parameters:
        roleId - the role id
        Returns:
        the role
      • create

        public Role create​(String name)
        Creates a new Role
        Specified by:
        create in interface RoleService
        Parameters:
        name - the name of the role
        Returns:
        the role
      • getByName

        public Role getByName​(String name)
        Gets a Role by Name
        Specified by:
        getByName in interface RoleService
        Parameters:
        name - the name of the Role
        Returns:
        the Role or null if not found