Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

(no description)

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

Defines 1 class

course_capability_assignment:: (6 methods):
  allow()
  prohibit()
  prevent()
  __construct()
  assign()
  revoke()


Class: course_capability_assignment  - X-Ref

Aids in capability assignment and alteration of the assigned capability.

allow($capability, $roleid, $contextid)   X-Ref
Assigns a capability to a role at the given context giving it permission.

param: string|array $capability The capability to assign.
param: int $roleid The roleID to assign to.
param: int $contextid The contextID for where to make the assignment.
return: course_capability_assignment

prohibit($capability, $roleid, $contextid)   X-Ref
Assigns a capability to a role at the given context prohibiting it.

param: string|array $capability The capability to assign.
param: int $roleid The roleID to assign to.
param: int $contextid The contextID for where to make the assignment.
return: course_capability_assignment

prevent($capability, $roleid, $contextid)   X-Ref
Assigns a capability to a role at the given context preventing it.

param: string|array $capability The capability to assign.
param: int $roleid The roleID to assign to.
param: int $contextid The contextID for where to make the assignment.
return: course_capability_assignment

__construct($capability, $roleid, $contextid, $permission)   X-Ref
Creates a new course_capability_assignment object

param: string|array $capability The capability to assign.
param: int $roleid The roleID to assign to.
param: int $contextid The contextID for where to make the assignment.
param: int $permission The permission to apply. One of CAP_ALLOW, CAP_PROHIBIT, CAP_PREVENT.
return: course_capability_assignment

assign($permission)   X-Ref
Assign a new permission.

param: int $permission One of CAP_ALLOW, CAP_PROHIBIT, CAP_PREVENT

revoke()   X-Ref
Revokes the capability assignment.