MoodleScript: ASSIGN ROLE

MoodleScript Script Engine

Effect

Assigns a role to a user in a given context.

Syntax

  ASSIGN ROLE <roleshortname> TO <useridentifier> IN <courseidentifier>

Examples

  ASSIGN ROLE student TO idnumber:U345654 IN idnumber:2022_C104
  ASSIGN ROLE editingteacher TO username:"admin" IN shortname:TESTCOURSE

Specific attributes

Other defaults

None

Back to the language index - Back to the component index