|
| 1 | +@javascript @retry |
| 2 | +Feature: Manage Roles |
| 3 | + As a site administrator |
| 4 | + I want to create and manage group roles on my site |
| 5 | + So that I can control access to the CMS |
| 6 | + |
| 7 | + Background: |
| 8 | + Given a "group" "Jane" |
| 9 | + And the "role" "This role is just another role" |
| 10 | + And the "role" "View draft content" has permissions "View draft content" |
| 11 | + And the "page" "My page" |
| 12 | + And I am logged in with "ADMIN" permissions |
| 13 | + And I go to "/admin/security" |
| 14 | + |
| 15 | + Scenario: I can create a new role with permissions |
| 16 | + When I click the "Roles" CMS tab |
| 17 | + And I press the "Add Role" button |
| 18 | + And I fill in "Title" with "MyRole" |
| 19 | + And I check "View draft content" |
| 20 | + And I press the "Create" button |
| 21 | + Then I should not see "Validation Error" |
| 22 | + And the "View draft content" checkbox should be checked |
| 23 | + |
| 24 | + Scenario: Manage roles link works correctly |
| 25 | + When I click the "Groups" CMS tab |
| 26 | + And I click "Jane" in the "#Form_EditForm_groups" element |
| 27 | + And I click the "Roles" CMS tab |
| 28 | + And I click "Manage roles" in the "#Root_Roles" element |
| 29 | + Then I should see "Add Role" |
| 30 | + And I should see "This role is just another role" |
| 31 | + |
| 32 | + Scenario: Members of a group with role permissions can view draft content |
| 33 | + When I click the "Groups" CMS tab |
| 34 | + And I click "Jane" in the "#Form_EditForm_groups" element |
| 35 | + And I click the "Roles" CMS tab |
| 36 | + And I select "View draft content" from "Roles[]" |
| 37 | + And I press the "Save" button |
| 38 | + Then I should not see "Validation Error" |
| 39 | + Given I go to "/Security/login" |
| 40 | + And I press the "Log in as someone else" button |
| 41 | + And I am logged in as a member of "Jane" group |
| 42 | + When I go to "/my-page?stage=Stage" |
| 43 | + Then I should see "My page" |
0 commit comments