Interface RoleProvider

All Known Subinterfaces:
AAIRoleProvider, GroupRoleProvider
All Known Implementing Classes:
BrightspaceUserProviderInstance, CanvasUserRoleProvider, CaptureAgentAdminRoleProviderImpl, ConfigurableLoginHandler, CustomRoleProvider, DynamicLoginHandler, ExternalApiRoleProvider, InMemoryUserAndRoleProvider, JpaGroupRoleProvider, JpaUserAndRoleProvider, JpaUserReferenceProvider, JWTRoleProvider, MoodleUserProviderInstance, OrganizationRoleProvider, SakaiUserProviderInstance, StudipUserProviderInstance, UIRolesRoleProvider, UserIdRoleProvider

public interface RoleProvider
Mix-in interface for directories that can list roles.
  • Method Summary

    Modifier and Type
    Method
    Description
    findRoles(String query, Role.Target target, int offset, int limit)
    Return the found roles as an iterator.
    default Iterator<Role>
    findRoles(String query, Role.Target target, int offset, int limit, Boolean hasUser)
    Return the found roles as an iterator, optionally filtered by whether or not each role corresponds to an actual user account.
    Returns the identifier for the organization that is defining this set of roles.
    Returns the roles for this user or an empty array if no roles are applicable.
  • Method Details

    • getRolesForUser

      List<Role> getRolesForUser(String userName)
      Returns the roles for this user or an empty array if no roles are applicable.
      Parameters:
      userName - the user id
      Returns:
      the set of roles
    • getOrganization

      String getOrganization()
      Returns the identifier for the organization that is defining this set of roles.
      Returns:
      the defining organization
    • findRoles

      Iterator<Role> findRoles(String query, Role.Target target, int offset, int limit)
      Return the found roles as an iterator.
      Parameters:
      query - the query. Use the wildcards "_" to match any single character and "%" to match an arbitrary number of characters (including zero characters).
      offset - the offset
      limit - the limit. 0 means no limit
      Returns:
      an iterator of role's
      Throws:
      IllegalArgumentException - if the query is null
    • findRoles

      default Iterator<Role> findRoles(String query, Role.Target target, int offset, int limit, Boolean hasUser)
      Return the found roles as an iterator, optionally filtered by whether or not each role corresponds to an actual user account.
      Parameters:
      query - the query. Use the wildcards "_" to match any single character and "%" to match an arbitrary number of characters (including zero characters).
      offset - the offset
      limit - the limit. 0 means no limit
      hasUser - if null, roles are not filtered by this criterion. If true, only roles that resolve to an actual user account should be returned. If false, only roles that do not resolve to a user account should be returned. Providers that can never produce a role resolving to a user account may use this to skip expensive work when hasUser is true, and vice versa.
      Returns:
      an iterator of role's
      Throws:
      IllegalArgumentException - if the query is null