capability_support
class capability_support
| internal |
Utility functions for Moodle capabilities and permissions.
Methods
static bool|null
static string
get_string(string $capability)
Retrieves the human-readable name of a capability.
Details
at line 42
static bool|null
has(string $capability, context $context, null|int|stdClass $user = null, bool $doanything = true)
Checks if a user has a specific capability in a given context.
at line 60
static string
get_string(string $capability)
Retrieves the human-readable name of a capability.
at line 77
static void
require(string $capability, context $context, null|int|stdClass $user = null, bool $doanything = true, string $errormessage = 'nopermissions', string $stringfile = '')
Requires the user to have a specific capability, throwing an exception if they don't.