[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 @tool @tool_behat 2 Feature: Edit capabilities 3 In order to extend and restrict moodle features 4 As an admin or a teacher 5 I need to allow/deny the existing capabilities at different levels 6 7 Background: 8 Given the following "users" exist: 9 | username | firstname | lastname | email | 10 | teacher1 | Teacher | 1 | [email protected] | 11 And the following "courses" exist: 12 | fullname | shortname | category | 13 | Course 1 | C1 | 0 | 14 And the following "course enrolments" exist: 15 | user | course | role | 16 | teacher1 | C1 | editingteacher | 17 18 @javascript 19 Scenario: Default system capabilities modification 20 Given I log in as "admin" 21 And I set the following system permissions of "Teacher" role: 22 | capability | permission | 23 | block/mnet_hosts:myaddinstance | Allow | 24 | moodle/community:add | Inherit | 25 | moodle/grade:managesharedforms | Prevent | 26 | moodle/course:request | Prohibit | 27 When I follow "Edit Teacher role" 28 Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission 29 And "moodle/community:add" capability has "Not set" permission 30 And "moodle/grade:managesharedforms" capability has "Prevent" permission 31 And "moodle/course:request" capability has "Prohibit" permission 32 33 @javascript 34 Scenario: Course capabilities overrides 35 Given I log in as "teacher1" 36 And I follow "Course 1" 37 And I expand "Users" node 38 And I follow "Permissions" 39 And I override the system permissions of "Student" role with: 40 | mod/forum:deleteanypost | Prohibit | 41 | mod/forum:editanypost | Prevent | 42 | mod/forum:addquestion | Allow | 43 When I set the field "Advanced role override" to "Student (3)" 44 Then "mod/forum:deleteanypost" capability has "Prohibit" permission 45 And "mod/forum:editanypost" capability has "Prevent" permission 46 And "mod/forum:addquestion" capability has "Allow" permission 47 48 @javascript 49 Scenario: Module capabilities overrides 50 Given I log in as "teacher1" 51 And I follow "Course 1" 52 And I turn editing mode on 53 And I add a "Forum" to section "1" and I fill the form with: 54 | Forum name | I'm the name | 55 | Description | I'm the introduction | 56 And I follow "I'm the name" 57 And I follow "Permissions" 58 And I override the system permissions of "Student" role with: 59 | mod/forum:deleteanypost | Prohibit | 60 | mod/forum:editanypost | Prevent | 61 | mod/forum:addquestion | Allow | 62 When I set the field "Advanced role override" to "Student (3)" 63 Then "mod/forum:deleteanypost" capability has "Prohibit" permission 64 And "mod/forum:editanypost" capability has "Prevent" permission 65 And "mod/forum:addquestion" capability has "Allow" permission
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |