silverstripe-cms/tests/behat/features/manage-page-permissions.feature

59 lines
2.5 KiB
Gherkin
Raw Normal View History

Feature: Manage global page permissions
2016-02-15 02:58:24 +01:00
As an administrator
I want to manage view and edit permission defaults on pages
In order to set good defaults and avoid repeating myself on each page
2016-02-15 02:58:24 +01:00
Background:
Given a "page" "Home" with "Content"="<p>Welcome</p>"
And a "group" "AUTHOR group" has permissions "Access to 'Pages' section"
And a "group" "SECURITY group" has permissions "Access to 'Security' section"
And I am logged in with "ADMIN" permissions
And I go to "admin/settings"
And I click the "Access" CMS tab
2016-02-15 02:58:24 +01:00
Scenario: I can open global view permissions to everyone
Given I select "Anyone" from "Who can view pages on this site?" input group
And I press the "Save" button
When I am not logged in
And I go to the homepage
Then I should see "Welcome"
2016-02-15 02:58:24 +01:00
Scenario: I can limit global view permissions to logged-in users
Given I select "Logged-in users" from "Who can view pages on this site?" input group
And I press the "Save" button
When I am not logged in
And I go to the homepage
Then I should see a log-in form
When I am logged in with "AUTHOR" permissions
And I go to the homepage
Then I should see "Welcome"
2016-02-15 02:58:24 +01:00
Scenario: I can limit global view permissions to certain groups
Given I select "Only these groups (choose from list)" from "Who can view pages on this site?" input group
2016-02-15 02:58:24 +01:00
And I select "AUTHOR group" from "Viewer Groups" with javascript
And I press the "Save" button
When I am not logged in
And I go to the homepage
Then I should see a log-in form
When I am logged in with "SECURITY" permissions
And I go to the homepage
Then I will see a "warning" log-in message
When I am not logged in
And I am logged in with "AUTHOR" permissions
And I go to the homepage
Then I should see "Welcome"
2016-02-15 02:58:24 +01:00
Scenario: I can limit global edit permissions to logged-in users
Given I select "Anyone who can log-in to the CMS" from "Who can edit pages on this site?" input group
And I press the "Save" button
Then pages should be editable by "AUTHOR"
And pages should be editable by "ADMIN"
2016-02-15 02:58:24 +01:00
Scenario: I can limit global edit permissions to certain groups
Given I select "Only these groups (choose from list)" from "Who can edit pages on this site?" input group
2016-02-15 02:58:24 +01:00
And I select "ADMIN group" from "Editor Groups" with javascript
And I press the "Save" button
Then pages should not be editable by "AUTHOR"
But pages should be editable by "ADMIN"