Class CustomRoleProvider

java.lang.Object
org.opencastproject.userdirectory.CustomRoleProvider
All Implemented Interfaces:
RoleProvider

public class CustomRoleProvider extends Object implements RoleProvider
An in-memory role provider containing administratively-defined custom roles
  • Field Details

    • CUSTOM_ROLES_KEY

      public static final String CUSTOM_ROLES_KEY
      Configuration key for the custom role list
      See Also:
    • CUSTOM_ROLES_PATTERN_KEY

      public static final String CUSTOM_ROLES_PATTERN_KEY
      Configuration key for the custom role pattern
      See Also:
    • securityService

      protected SecurityService securityService
      The security service
  • Constructor Details

    • CustomRoleProvider

      public CustomRoleProvider()
  • Method Details

    • setSecurityService

      public void setSecurityService(SecurityService securityService)
      Parameters:
      securityService - the securityService to set
    • activate

      protected void activate(org.osgi.service.component.ComponentContext cc)
      Callback to activate the component.
      Parameters:
      cc - the declarative services component context
    • getOrganization

      public String getOrganization()
      Returns the identifier for the organization that is defining this set of roles.
      Specified by:
      getOrganization in interface RoleProvider
      Returns:
      the defining organization
      See Also:
    • getRolesForUser

      public List<Role> getRolesForUser(String userName)
      Description copied from interface: RoleProvider
      Returns the roles for this user or an empty array if no roles are applicable.
      Specified by:
      getRolesForUser in interface RoleProvider
      Parameters:
      userName - the user id
      Returns:
      the set of roles
      See Also:
    • findRoles

      public Iterator<Role> findRoles(String query, Role.Target target, int offset, int limit)
      Description copied from interface: RoleProvider
      Return the found roles as an iterator.
      Specified by:
      findRoles in interface RoleProvider
      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
      See Also: