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>"
|
2022-09-05 22:44:46 +02:00
|
|
|
And a "group" "EDITOR" has permissions "Access to 'Pages' section"
|
|
|
|
And a "group" "SECURITY" has permissions "Access to 'Security' section"
|
2016-02-15 02:58:24 +01:00
|
|
|
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"
|
|
|
|
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
|
2018-02-09 00:18:57 +01:00
|
|
|
And I press the "Publish" button
|
2016-02-15 02:58:24 +01:00
|
|
|
When I am not logged in
|
|
|
|
And I go to the homepage
|
|
|
|
Then I should see a log-in form
|
2022-09-05 22:44:46 +02:00
|
|
|
When I am logged in as a member of "EDITOR" group
|
2016-02-15 02:58:24 +01:00
|
|
|
And I go to the homepage
|
|
|
|
Then I should see "Welcome"
|
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
|
2022-09-05 22:44:46 +02:00
|
|
|
And I select "EDITOR" in the "#Form_EditForm_ViewerGroups_Holder" tree dropdown
|
2018-02-09 00:18:57 +01:00
|
|
|
And I press the "Publish" button
|
2016-02-15 02:58:24 +01:00
|
|
|
When I am not logged in
|
|
|
|
And I go to the homepage
|
|
|
|
Then I should see a log-in form
|
2022-09-05 22:44:46 +02:00
|
|
|
When I am logged in as a member of "SECURITY" group
|
2016-02-15 02:58:24 +01:00
|
|
|
And I go to the homepage
|
|
|
|
Then I will see a "warning" log-in message
|
|
|
|
When I am not logged in
|
2022-09-05 22:44:46 +02:00
|
|
|
And I am logged in as a member of "EDITOR" group
|
2016-02-15 02:58:24 +01:00
|
|
|
And I go to the homepage
|
|
|
|
Then I should see "Welcome"
|
2017-07-17 03:31:14 +02:00
|
|
|
Scenario: I can limit page edit permissions to logged-in users
|
2022-09-05 22:44:46 +02:00
|
|
|
Given I am not logged in
|
|
|
|
And I am logged in as a member of "EDITOR" group
|
|
|
|
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
|
|
|
|
And I select "Logged-in users" from "Who can edit this page?" input group
|
2018-02-09 00:18:57 +01:00
|
|
|
And I press the "Publish" button
|
2022-09-05 22:44:46 +02:00
|
|
|
Then pages should be editable by "EDITOR"
|
2016-02-15 02:58:24 +01:00
|
|
|
And pages should be editable by "ADMIN"
|
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
|
2018-02-09 00:18:57 +01:00
|
|
|
And I press the "Publish" button
|
2022-09-05 22:44:46 +02:00
|
|
|
Then pages should not be editable by "EDITOR"
|
2016-02-15 02:58:24 +01:00
|
|
|
But pages should be editable by "ADMIN"
|
2013-09-13 18:46:23 +02:00
|
|
|
|