2 Feature: Role assignments can be made at the category level
3 In order to grant a user different capabilities
5 I can assign roles in categories
8 Given the following "users" exist:
9 | username | firstname | lastname |
10 | manager | Manager | Manager |
11 And the following "categories" exist:
12 | name | category | idnumber |
14 And the following "role assigns" exist:
15 | user | role | contextlevel | reference |
16 | manager | manager | Category | CAT1 |
17 And I log in as "admin"
20 Scenario: A user with a category role can assign roles
21 Given I define the allowed role assignments for the "Manager" role as:
22 | Teacher | Assignable |
24 And I log in as "manager"
25 And I am on course index
27 Then "Assign roles" "link" should exist in current page administration
30 Scenario: A user with a category role cannot assign roles if there are no roles to assign
31 Given I define the allowed role assignments for the "Manager" role as:
32 | Manager | Not assignable |
33 | Course creator | Not assignable |
34 | Teacher | Not assignable |
35 | Non-editing teacher | Not assignable |
36 | Student | Not assignable |
38 And I log in as "manager"
39 And I am on course index
41 Then "Assign roles" "link" should not exist in current page administration