1
0
mirror of https://github.com/silverstripe/silverstripe-framework synced 2024-10-22 14:05:37 +02:00

mlanthaler: Added permission check for edit rights and changed the labels according to Sigs suggestions.

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41823 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-15 00:06:49 +00:00
parent 4a0b7e1d6d
commit be2f2243ae

View File

@ -506,9 +506,10 @@ class SiteTree extends DataObject {
switch(strtolower($perm)) { switch(strtolower($perm)) {
case 'edit': case 'edit':
if((($this->Editors == 'LoggedInUsers' && $member) || if((Permission::check('CMS_ACCESS_CMSMain') &&
($this->Editors == 'OnlyTheseUsers' && $member && (($this->Editors == 'LoggedInUsers' && $member) ||
$member->isInGroup($this->EditorsGroup))) == false) ($this->Editors == 'OnlyTheseUsers' && $member &&
$member->isInGroup($this->EditorsGroup)))) == false)
return false; return false;
break; break;
@ -1023,15 +1024,15 @@ class SiteTree extends DataObject {
) )
), ),
new Tab("Access", new Tab("Access",
new HeaderField("Who can display this?", 2), new HeaderField("Who can view this page on my site?", 2),
new OptionsetField("Viewers", "", new OptionsetField("Viewers", "",
array("Anyone" => "Anyone", array("Anyone" => "Anyone",
"LoggedInUsers" => "Logged-in users", "LoggedInUsers" => "Logged-in users",
"OnlyTheseUsers" => "Only these people (choose from list)")), "OnlyTheseUsers" => "Only these people (choose from list)")),
new DropdownField("ViewersGroup", "Group", Group::map()), new DropdownField("ViewersGroup", "Group", Group::map()),
new HeaderField("Who can edit this?", 2), new HeaderField("Who can edit this inside the CMS?", 2),
new OptionsetField("Editors", "", new OptionsetField("Editors", "",
array("LoggedInUsers" => "Logged-in users", array("LoggedInUsers" => "Anyone who can log-in to the CMS",
"OnlyTheseUsers" => "Only these people (choose from list)")), "OnlyTheseUsers" => "Only these people (choose from list)")),
new DropdownField("EditorsGroup", "Group", Group::map()) new DropdownField("EditorsGroup", "Group", Group::map())
) )