Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401]

Steps definitions related with permissions.

Copyright: 2013 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 322 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/behat/behat_base.php

Defines 1 class


Class: behat_permissions  - X-Ref

Steps definitions to set up permissions to capabilities.

i_set_the_following_system_permissions_of_role($rolename, $table)   X-Ref
Set system level permissions to the specified role. Expects a table with capability name and permission (Inherit/Allow/Prevent/Prohibit) columns.

param: string $rolename
param: TableNode $table

i_override_the_system_permissions_of_role_with($rolename, $table)   X-Ref
Overrides system capabilities at category, course and module levels. This step begins after clicking 'Permissions' link. Expects a table with capability name and permission (Inherit/Allow/Prevent/Prohibit) columns.

param: string $rolename
param: TableNode $table

i_fill_the_capabilities_form_with_the_following_permissions($table)   X-Ref
Fills the advanced permissions form with the provided data. Expects a table with capability name and permission (Inherit/Allow/Prevent/Prohibit) columns.

param: TableNode $table
return: void

capability_has_permission($capabilityname, $permission)   X-Ref
Checks if the capability has the specified permission. Works in the role definition advanced page.

param: string $capabilityname
param: string $permission
return: void

i_define_the_allowed_role_assignments_for_a_role_as($rolename, $table)   X-Ref
Set the allowed role assignments for the specified role.

param: string $rolename
param: TableNode $table
return: void Executes other steps

i_fill_in_the_allowed_role_assignments_form_for_a_role_with($sourcerole, $table)   X-Ref
Fill in the allowed role assignments form for the specied role.

Takes a table with two columns. Each row should contain the target
role, and either "Assignable" or "Not assignable".

param: String $sourcerole
param: TableNode $table
return: void

the_context_is_context_frozen(string $element, string $selector)   X-Ref
Mark context as frozen.

param: string $element Element we look on
param: string $selector The type of where we look (activity, course)

the_context_is_not_context_frozen(string $element, string $selector)   X-Ref
Unmark context as frozen.

param: string $element Element we look on
param: string $selector The type of where we look (activity, course)