Lti_1p3.Tool.PlatformRoles (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.PlatformRole.t()], Lti_1p3.Tool.PlatformRole.t()) :: boolean()
Returns true if a list of roles contains a given role
get_highest_role(roles)
@spec get_highest_role([Lti_1p3.Tool.PlatformRole.t()]) :: Lti_1p3.Tool.PlatformRole.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)
Returns all valid roles from a list of uris
has_role?(user, role)
@spec has_role?(Lti_1p3.Tool.Lti_1p3_User.t(), Lti_1p3.Tool.PlatformRole.t()) :: boolean()
Returns true if a user has a given role
has_roles?(user, roles, atom)
@spec has_roles?(Lti_1p3.Tool.Lti_1p3_User.t(), [Lti_1p3.Tool.PlatformRole.t()], :any) :: boolean()
@spec has_roles?(Lti_1p3.Tool.Lti_1p3_User.t(), [Lti_1p3.Tool.PlatformRole.t()], :all) :: boolean()
Returns true if a user has any of the given roles