Merge pull request #1880 from robbieaverill/pulls/4.0/change-people-to-groups

NEW Change "only these people" to "only these groups" in permissions
This commit is contained in:
Daniel Hensby 2017-07-17 13:17:04 +01:00 committed by GitHub
commit 91ced1cf1d
3 changed files with 24 additions and 21 deletions

View File

@ -2010,7 +2010,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
InheritedPermissions::LOGGED_IN_USERS => _t(__CLASS__.'.ACCESSLOGGEDIN', "Logged-in users"), InheritedPermissions::LOGGED_IN_USERS => _t(__CLASS__.'.ACCESSLOGGEDIN', "Logged-in users"),
InheritedPermissions::ONLY_THESE_USERS => _t( InheritedPermissions::ONLY_THESE_USERS => _t(
__CLASS__.'.ACCESSONLYTHESE', __CLASS__.'.ACCESSONLYTHESE',
"Only these people (choose from list)" "Only these groups (choose from list)"
), ),
]; ];
$viewersOptionsField->setSource($viewersOptionsSource); $viewersOptionsField->setSource($viewersOptionsSource);

View File

@ -164,7 +164,7 @@ en:
ACCESSANYONE: Anyone ACCESSANYONE: Anyone
ACCESSHEADER: 'Who can view this page?' ACCESSHEADER: 'Who can view this page?'
ACCESSLOGGEDIN: 'Logged-in users' ACCESSLOGGEDIN: 'Logged-in users'
ACCESSONLYTHESE: 'Only these people (choose from list)' ACCESSONLYTHESE: 'Only these groups (choose from list)'
ADDEDTODRAFTHELP: 'Page has not been published yet' ADDEDTODRAFTHELP: 'Page has not been published yet'
ADDEDTODRAFTSHORT: Draft ADDEDTODRAFTSHORT: Draft
APPEARSVIRTUALPAGES: 'This content also appears on the virtual pages in the {title} sections.' APPEARSVIRTUALPAGES: 'This content also appears on the virtual pages in the {title} sections.'

View File

@ -1,25 +1,28 @@
Feature: Manage global page permissions Feature: Manage page permissions
As an administrator As an administrator
I want to manage view and edit permission defaults on pages I want to manage view and edit permissions on pages
In order to set good defaults and avoid repeating myself on each page In order to allow certain groups of people to view or edit a given page
Background: Background:
Given a "page" "Home" with "Content"="<p>Welcome</p>" Given a "page" "Home" with "Content"="<p>Welcome</p>"
And a "group" "AUTHOR group" has permissions "Access to 'Pages' section" And a "group" "AUTHOR group" has permissions "Access to 'Pages' section"
And a "group" "SECURITY group" has permissions "Access to 'Security' section" And a "group" "SECURITY group" has permissions "Access to 'Security' section"
And I am logged in with "ADMIN" permissions And I am logged in with "ADMIN" permissions
And I go to "admin/settings" And I go to "/admin/pages"
And I click the "Access" CMS tab And I click on "Home" in the tree
Then I should see an edit page form
And I click the "Settings" CMS tab
Scenario: I can open global view permissions to everyone # BUG: https://github.com/silverstripe/silverstripe-cms/issues/1897
Given I select "Anyone" from "Who can view pages on this site?" input group # Scenario: I can open view permissions to everyone
And I press the "Save" button # Given I select "Anyone" from "Who can view this page?" input group
When I am not logged in # And I press the "Save" button
And I go to the homepage # When I am not logged in
Then I should see "Welcome" # And I go to the homepage
# Then I should see "Welcome"
Scenario: I can limit global view permissions to logged-in users Scenario: I can limit page view permissions to logged-in users
Given I select "Logged-in users" from "Who can view pages on this site?" input group Given I select "Logged-in users" from "Who can view this page?" input group
And I press the "Save" button And I press the "Save" button
When I am not logged in When I am not logged in
And I go to the homepage And I go to the homepage
@ -28,8 +31,8 @@ Feature: Manage global page permissions
And I go to the homepage And I go to the homepage
Then I should see "Welcome" Then I should see "Welcome"
Scenario: I can limit global view permissions to certain groups Scenario: I can limit page view permissions to certain groups
Given I select "Only these people (choose from list)" from "Who can view pages on this site?" input group Given I select "Only these groups (choose from list)" from "Who can view this page?" input group
And I select "AUTHOR group" from "Viewer Groups" with javascript And I select "AUTHOR group" from "Viewer Groups" with javascript
And I press the "Save" button And I press the "Save" button
When I am not logged in When I am not logged in
@ -43,14 +46,14 @@ Feature: Manage global page permissions
And I go to the homepage And I go to the homepage
Then I should see "Welcome" Then I should see "Welcome"
Scenario: I can limit global edit permissions to logged-in users Scenario: I can limit page 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 Given I select "Logged-in users" from "Who can edit this page?" input group
And I press the "Save" button And I press the "Save" button
Then pages should be editable by "AUTHOR" Then pages should be editable by "AUTHOR"
And pages should be editable by "ADMIN" And pages should be editable by "ADMIN"
Scenario: I can limit global edit permissions to certain groups Scenario: I can limit page edit permissions to certain groups
Given I select "Only these people (choose from list)" from "Who can edit pages on this site?" input group Given I select "Only these groups (choose from list)" from "Who can edit this page?" input group
And I select "ADMIN group" from "Editor Groups" with javascript And I select "ADMIN group" from "Editor Groups" with javascript
And I press the "Save" button And I press the "Save" button
Then pages should not be editable by "AUTHOR" Then pages should not be editable by "AUTHOR"