1 |
efrain |
1 |
@tool @tool_capability
|
|
|
2 |
Feature: Show capabilities for multiple contexts
|
|
|
3 |
In order to check roles capabilities
|
|
|
4 |
As an admin
|
|
|
5 |
I need to be able to see capability overrides on several contexts
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
And the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
| Course 2 | C2 | 0 |
|
|
|
12 |
And the following "permission overrides" exist:
|
|
|
13 |
| capability | permission | role | contextlevel | reference |
|
|
|
14 |
| enrol/category:config | Allow | student | Course | C1 |
|
|
|
15 |
| enrol/cohort:unenrol | Allow | student | Course | C2 |
|
|
|
16 |
And I log in as "admin"
|
|
|
17 |
And I navigate to "Users > Permissions > Capability overview" in site administration
|
|
|
18 |
|
|
|
19 |
Scenario: Show capabilities table with one capability with overrides
|
|
|
20 |
When I set the following fields to these values:
|
|
|
21 |
| Capability: | enrol/category:config |
|
|
|
22 |
| Roles: | Student |
|
|
|
23 |
And I click on "Get the overview" "button"
|
|
|
24 |
Then I should see "Permissions in System"
|
|
|
25 |
And I should see "Permissions in Category: Category 1"
|
|
|
26 |
And I should see "Permissions in Course: Course 1"
|
|
|
27 |
And I should not see "Permissions in Course: Course 2"
|
|
|
28 |
|
|
|
29 |
Scenario: Show capabilities table with one capability without overrides
|
|
|
30 |
When I set the following fields to these values:
|
|
|
31 |
| Capability: | enrol/cohort:config |
|
|
|
32 |
| Roles: | Student |
|
|
|
33 |
And I click on "Get the overview" "button"
|
|
|
34 |
Then I should see "Permissions in System"
|
|
|
35 |
And I should not see "Permissions in Category: Category 1"
|
|
|
36 |
And I should not see "Permissions in Course: Course 1"
|
|
|
37 |
And I should not see "Permissions in Course: Course 2"
|
|
|
38 |
|
|
|
39 |
Scenario: Show capabilities table with two capabilities, 1st without overrides and 2nd with
|
|
|
40 |
When I set the following fields to these values:
|
|
|
41 |
| Capability: | enrol/category:synchronised, enrol/category:config |
|
|
|
42 |
| Roles: | Student |
|
|
|
43 |
And I click on "Get the overview" "button"
|
|
|
44 |
Then I should see "Permissions in System"
|
|
|
45 |
And I should see "Permissions in Category: Category 1"
|
|
|
46 |
And I should see "Permissions in Course: Course 1"
|
|
|
47 |
And I should not see "Permissions in Course: Course 2"
|
|
|
48 |
|
|
|
49 |
Scenario: Show capabilities table with two capabilities, 1st with overrides and 2nd without
|
|
|
50 |
When I set the following fields to these values:
|
|
|
51 |
| Capability: | enrol/category:config, enrol/cohort:config |
|
|
|
52 |
| Roles: | Student |
|
|
|
53 |
And I click on "Get the overview" "button"
|
|
|
54 |
Then I should see "Permissions in System"
|
|
|
55 |
And I should see "Permissions in Category: Category 1"
|
|
|
56 |
And I should see "Permissions in Course: Course 1"
|
|
|
57 |
And I should not see "Permissions in Course: Course 2"
|
|
|
58 |
|
|
|
59 |
Scenario: Show capabilities table with two capabilities, none with overrides
|
|
|
60 |
When I set the following fields to these values:
|
|
|
61 |
| Capability: | enrol/category:synchronised, enrol/cohort:config |
|
|
|
62 |
| Roles: | Student |
|
|
|
63 |
And I click on "Get the overview" "button"
|
|
|
64 |
Then I should see "Permissions in System"
|
|
|
65 |
And I should not see "Permissions in Category: Category 1"
|
|
|
66 |
And I should not see "Permissions in Course: Course 1"
|
|
|
67 |
And I should not see "Permissions in Course: Course 2"
|
|
|
68 |
|
|
|
69 |
Scenario: Show capabilities table with capability with override and no role selected
|
|
|
70 |
When I set the following fields to these values:
|
|
|
71 |
| Capability: | enrol/category:config |
|
|
|
72 |
| Roles: | |
|
|
|
73 |
And I click on "Get the overview" "button"
|
|
|
74 |
Then I should see "Permissions in System"
|
|
|
75 |
And I should see "Permissions in Category: Category 1"
|
|
|
76 |
And I should see "Permissions in Course: Course 1"
|
|
|
77 |
And I should not see "Permissions in Course: Course 2"
|
|
|
78 |
|
|
|
79 |
Scenario: Show capabilities table with capability without override and no role selected
|
|
|
80 |
When I set the following fields to these values:
|
|
|
81 |
| Capability: | enrol/cohort:config |
|
|
|
82 |
| Roles: | |
|
|
|
83 |
And I click on "Get the overview" "button"
|
|
|
84 |
Then I should see "Permissions in System"
|
|
|
85 |
And I should not see "Permissions in Category: Category 1"
|
|
|
86 |
And I should not see "Permissions in Course: Course 1"
|
|
|
87 |
And I should not see "Permissions in Course: Course 2"
|
|
|
88 |
|
|
|
89 |
Scenario: Show capabilities table with capability with two overrides on different contexts
|
|
|
90 |
When I set the following fields to these values:
|
|
|
91 |
| Capability: | enrol/category:config, enrol/cohort:unenrol |
|
|
|
92 |
| Roles: | |
|
|
|
93 |
And I click on "Get the overview" "button"
|
|
|
94 |
Then I should see "Permissions in System"
|
|
|
95 |
And I should see "Permissions in Category: Category 1"
|
|
|
96 |
And I should see "Permissions in Course: Course 1"
|
|
|
97 |
And I should see "Permissions in Course: Course 2"
|
|
|
98 |
|
|
|
99 |
Scenario: Show capabilities table with capability with override and only diff
|
|
|
100 |
When I set the following fields to these values:
|
|
|
101 |
| Capability: | enrol/category:config |
|
|
|
102 |
| Roles: | Student, Teacher |
|
|
|
103 |
And I set the field "Show differences only" to "1"
|
|
|
104 |
And I click on "Get the overview" "button"
|
|
|
105 |
Then I should see "Permissions in System"
|
|
|
106 |
And I should see "Permissions in Category: Category 1"
|
|
|
107 |
And I should see "There are no differences to show between selected roles in this context"
|
|
|
108 |
And I should see "Permissions in Course: Course 1"
|
|
|
109 |
And I should not see "Permissions in Course: Course 2"
|
|
|
110 |
|
|
|
111 |
Scenario: Show capabilities table with capability without override and only diff and same capability
|
|
|
112 |
When I set the following fields to these values:
|
|
|
113 |
| Capability: | enrol/category:synchronised |
|
|
|
114 |
| Roles: | Student, Teacher |
|
|
|
115 |
And I set the field "Show differences only" to "1"
|
|
|
116 |
And I click on "Get the overview" "button"
|
|
|
117 |
Then I should see "Permissions in System"
|
|
|
118 |
And I should see "There are no differences to show between selected roles in this context"
|
|
|
119 |
And I should not see "Permissions in Category: Category 1"
|
|
|
120 |
And I should not see "Permissions in Course: Course 1"
|
|
|
121 |
And I should not see "Permissions in Course: Course 2"
|
|
|
122 |
|
|
|
123 |
Scenario: Show capabilities table with two capabilities only one override and only diff checked
|
|
|
124 |
When I set the following fields to these values:
|
|
|
125 |
| Capability: | enrol/category:config, enrol/cohort:config |
|
|
|
126 |
| Roles: | Student, Teacher |
|
|
|
127 |
And I set the field "Show differences only" to "1"
|
|
|
128 |
And I click on "Get the overview" "button"
|
|
|
129 |
Then I should see "Permissions in System"
|
|
|
130 |
And I should see "Permissions in Category: Category 1"
|
|
|
131 |
And I should see "There are no differences to show between selected roles in this context"
|
|
|
132 |
And I should see "Permissions in Course: Course 1"
|
|
|
133 |
And I should not see "Permissions in Course: Course 2"
|