Module: IMS::LTI::DeprecatedRoleChecks
- Included in:
- ToolProvider
- Defined in:
- lib/ims/lti/deprecated_role_checks.rb
Instance Method Summary collapse
-
#admin? ⇒ Boolean
Convenience method for checking if the user has ‘administrator’ role.
-
#content_developer? ⇒ Boolean
Convenience method for checking if the user has ‘contentdeveloper’ role.
-
#has_role?(role) ⇒ Boolean
Check whether the Launch Parameters have a role.
-
#instructor? ⇒ Boolean
Convenience method for checking if the user has ‘instructor’ or ‘faculty’ or ‘staff’ role.
-
#manager? ⇒ Boolean
Convenience method for checking if the user has ‘Manager’ role.
-
#member? ⇒ Boolean
Convenience method for checking if the user has ‘Member’ role.
-
#mentor? ⇒ Boolean
Convenience method for checking if the user has ‘Mentor’ role.
-
#student? ⇒ Boolean
Convenience method for checking if the user has ‘learner’ or ‘student’ role.
-
#ta? ⇒ Boolean
Convenience method for checking if the user has ‘TeachingAssistant’ role.
Instance Method Details
#admin? ⇒ Boolean
Convenience method for checking if the user has ‘administrator’ role
43 44 45 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 43 def admin? has_role?('administrator') end |
#content_developer? ⇒ Boolean
Convenience method for checking if the user has ‘contentdeveloper’ role
23 24 25 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 23 def content_developer? has_role?('ContentDeveloper') end |
#has_role?(role) ⇒ Boolean
Check whether the Launch Parameters have a role
7 8 9 10 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 7 def has_role?(role) role = role.downcase @roles && @roles.any?{|r| r.downcase.index(role)} end |
#instructor? ⇒ Boolean
Convenience method for checking if the user has ‘instructor’ or ‘faculty’ or ‘staff’ role
18 19 20 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 18 def instructor? has_role?('instructor') || has_role?('faculty') || has_role?('staff') end |
#manager? ⇒ Boolean
Convenience method for checking if the user has ‘Manager’ role
33 34 35 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 33 def manager? has_role?('Manager') end |
#member? ⇒ Boolean
Convenience method for checking if the user has ‘Member’ role
28 29 30 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 28 def member? has_role?('Member') end |
#mentor? ⇒ Boolean
Convenience method for checking if the user has ‘Mentor’ role
38 39 40 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 38 def mentor? has_role?('Mentor') end |
#student? ⇒ Boolean
Convenience method for checking if the user has ‘learner’ or ‘student’ role
13 14 15 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 13 def student? has_role?('learner') || has_role?('student') end |
#ta? ⇒ Boolean
Convenience method for checking if the user has ‘TeachingAssistant’ role
48 49 50 |
# File 'lib/ims/lti/deprecated_role_checks.rb', line 48 def ta? has_role?('TeachingAssistant') end |