===== MoodleScript: ADD CAPABILITY ===== ===== MoodleScript Script Engine ===== === Effect === Grants a permission for a capability on an existing role. This changes the central definition of the role. It does not create a local override. === Syntax === ADD CAPABILITY TO HAVING permisssion: Minimal instruction: ADD CAPABILITY IN === Examples === ADD CAPABILITY moodle/course:manageactivities IN shortname:teacher2 HAVING permission: allow === Specific attributes === * **capabilityname**: a capability name. * **roleidentifier**: a "role" object identifier. For example: shortname: * **permission**: a permission among //allow//, //prevent//, //prohibit//, or //inherit//. === Default values === * **permission** : allow === Other defaults === None [[:local:moodlescript:languagespecification|Back to the language index]] - [[:local:moodlescript|Back to the component index]]