Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Variables
access.php File Reference

Capability definitions for Moodle core. More...

Variables

 $capabilities
 

Detailed Description

Capability definitions for Moodle core.

The capabilities are loaded into the database table when the module is installed or updated. Whenever the capability definitions are updated, the module version number should be bumped up.

The system has four possible values for a capability: CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).

CAPABILITY NAMING CONVENTION

It is important that capability names are unique. The naming convention for capabilities that are specific to modules and blocks is as follows: [mod/block]/<plugin_name>:<capabilityname>

component_name should be the same as the directory name of the mod or block.

Core moodle capabilities are defined thus: moodle/<capabilityclass>:<capabilityname>

Examples: mod/forum:viewpost block/recent_activity:view moodle/site:deleteuser

The variable name for the capability definitions array is $capabilities

For more information, take a look to the documentation available: