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

Link to this function

contains_role?(roles, role)

Returns true if a list of roles contains a given role

Link to this function

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()

Returns a role from a given atom if it is valid, otherwise returns nil

Link to this function

get_role_by_uri(arg1)

Returns a role from a given uri if it is valid, otherwise returns nil

Link to this function

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

Link to this function

has_role?(user, context, role)

Returns true if a user has a given role

Link to this function

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