Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

File Size: 95 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

message_helper:: (3 methods):
  is_instructor_launch()
  user_is_staff()
  user_is_admin()


Class: message_helper  - X-Ref

Utility class for LTI Advantage messages.

is_instructor_launch(array $jwtdata)   X-Ref
Determine if the LTI roles in the launch contains any instructor or admin roles.

param: array $jwtdata array formatted JWT data from the launch.
return: bool true if the roles contain a constructor role, false otherwise.

user_is_staff(array $jwtdata, bool $includelegacyroles = false)   X-Ref
Check whether the launch user is an instructor.

param: array $jwtdata array formatted JWT data from the launch.
param: bool $includelegacyroles whether to also consider legacy simple names as valid roles.
return: bool true if the user is an instructor, false otherwise.

user_is_admin(array $jwtdata)   X-Ref
Check whether the launch user has an admin role.

param: array $jwtdata array formatted JWT data from the launch.
return: bool true if the user is admin, false otherwise.