2017-07-17 03:31:14 +02:00
|
|
|
Feature: Manage page permissions
|
2016-02-15 02:58:24 +01:00
|
|
|
As an administrator
|
2017-07-17 03:31:14 +02:00
|
|
|
I want to manage view and edit permissions on pages
|
|
|
|
In order to allow certain groups of people to view or edit a given page
|
2013-09-13 18:46:23 +02:00
|
|
|
|
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
|
2017-07-17 03:31:14 +02:00
|
|
|
And I go to "/admin/pages"
|
|
|
|
And I click on "Home" in the tree
|
|
|
|
Then I should see an edit page form
|
|
|
|
And I click the "Settings" CMS tab
|
2013-09-13 18:46:23 +02:00
|
|
|
|
2017-07-17 03:31:14 +02:00
|
|
|
# BUG: https://github.com/silverstripe/silverstripe-cms/issues/1897
|
|
|
|
# Scenario: I can open view permissions to everyone
|
|
|
|
# Given I select "Anyone" from "Who can view this page?" 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"
|
2013-11-28 11:22:44 +01:00
|
|
|
|
2017-07-17 03:31:14 +02:00
|
|
|
Scenario: I can limit page view permissions to logged-in users
|
|
|
|
Given I select "Logged-in users" from "Who can view this page?" input group
|
2016-02-15 02:58:24 +01:00
|
|
|
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"
|
2013-09-13 18:46:23 +02:00
|
|
|
|
2017-07-17 03:31:14 +02:00
|
|
|
Scenario: I can limit page view permissions to certain groups
|
|
|
|
Given I select "Only these groups (choose from list)" from "Who can view this page?" input group
|
2017-08-30 12:40:56 +02:00
|
|
|
And I select "AUTHOR group" in the "#Form_EditForm_ViewerGroups_Holder" tree dropdown
|
2016-02-15 02:58:24 +01:00
|
|
|
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"
|
2013-09-13 18:46:23 +02:00
|
|
|
|
2017-07-17 03:31:14 +02:00
|
|
|
Scenario: I can limit page edit permissions to logged-in users
|
|
|
|
Given I select "Logged-in users" from "Who can edit this page?" input group
|
2016-02-15 02:58:24 +01:00
|
|
|
And I press the "Save" button
|
|
|
|
Then pages should be editable by "AUTHOR"
|
|
|
|
And pages should be editable by "ADMIN"
|
2013-09-13 18:46:23 +02:00
|
|
|
|
2017-07-17 03:31:14 +02:00
|
|
|
Scenario: I can limit page edit permissions to certain groups
|
|
|
|
Given I select "Only these groups (choose from list)" from "Who can edit this page?" input group
|
2017-08-30 12:40:56 +02:00
|
|
|
And I select "ADMIN group" in the "#Form_EditForm_EditorGroups_Holder" tree dropdown
|
2016-02-15 02:58:24 +01:00
|
|
|
And I press the "Save" button
|
|
|
|
Then pages should not be editable by "AUTHOR"
|
|
|
|
But pages should be editable by "ADMIN"
|
2013-09-13 18:46:23 +02:00
|
|
|
|