Lti_1p3.Tool.ContextRoles (Lti 1p3 v0.6.0)
Link to this section Summary
Functions
Returns true if a list of roles contains a given role
Returns the highest level role from a list of roles. This function assumes roles have an ordinality which is defined by list_roles()
Returns a role from a given atom if it is valid, otherwise returns nil
Returns a role from a given uri if it is valid, otherwise returns nil
Returns all valid roles from a list of uris
Returns true if a user has a given role
Returns true if a user has any of the given roles
Link to this section Functions
contains_role?(roles, role)
@spec contains_role?([Lti_1p3.Tool.ContextRole.t()], Lti_1p3.Tool.ContextRole.t()) :: boolean()
Returns true if a list of roles contains a given role
get_highest_role(roles)
@spec get_highest_role([Lti_1p3.Tool.ContextRole.t()]) :: Lti_1p3.Tool.ContextRole.t()
Returns the highest level role from a list of roles. This function assumes roles have an ordinality which is defined by list_roles()
get_role(arg1)
Returns a role from a given atom if it is valid, otherwise returns nil
get_role_by_uri(arg1)
Returns a role from a given uri if it is valid, otherwise returns nil
get_roles_by_uris(uris)
@spec get_roles_by_uris([String.t()]) :: [Lti_1p3.Tool.ContextRole.t()]
Returns all valid roles from a list of uris
has_role?(user, context, role)
@spec has_role?(Lti_1p3.Tool.Lti_1p3_User.t(), any(), Lti_1p3.Tool.ContextRole.t()) :: boolean()
Returns true if a user has a given role
has_roles?(user, context, roles, atom)
@spec has_roles?( Lti_1p3.Tool.Lti_1p3_User.t(), any(), [Lti_1p3.Tool.ContextRole.t()], :any ) :: boolean()
@spec has_roles?( Lti_1p3.Tool.Lti_1p3_User.t(), any(), [Lti_1p3.Tool.ContextRole.t()], :all ) :: boolean()
Returns true if a user has any of the given roles