Package org.opencastproject.security.api
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 TypeMethodDescriptionfindRoles(String query, Role.Target target, int offset, int limit) Return the found roles as an iterator.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.getRolesForUser(String userName) Returns the roles for this user or an empty array if no roles are applicable.
-
Method Details
-
getRolesForUser
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
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 offsetlimit- the limit. 0 means no limit- Returns:
- an iterator of role's
- Throws:
IllegalArgumentException- if the query isnull
-
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 offsetlimit- the limit. 0 means no limithasUser- ifnull, roles are not filtered by this criterion. Iftrue, only roles that resolve to an actual user account should be returned. Iffalse, 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 whenhasUseristrue, and vice versa.- Returns:
- an iterator of role's
- Throws:
IllegalArgumentException- if the query isnull
-