From e57be3f6e412edcb7e70e87d132e494b6a048636 Mon Sep 17 00:00:00 2001 From: sminnee Date: Thu, 15 Oct 2009 03:06:37 +0000 Subject: [PATCH] API CHANGE Always allow users with ADMIN permissions to view or edit SiteConfig git-svn-id: http://svn.silverstripe.com/modules/sapphire/branches/airnz/iteration3@89049 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/model/SiteConfig.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/model/SiteConfig.php b/code/model/SiteConfig.php index 0bb58ffc..31db3761 100644 --- a/code/model/SiteConfig.php +++ b/code/model/SiteConfig.php @@ -217,6 +217,8 @@ class SiteConfig extends DataObject implements PermissionProvider { if(!$member) $member = Member::currentUserID(); if($member && is_numeric($member)) $member = DataObject::get_by_id('Member', $member); + if ($member && Permission::checkMember($member, "ADMIN")) return true; + if (!$this->CanViewType || $this->CanViewType == 'Anyone') return true; // check for any logged-in users @@ -240,6 +242,8 @@ class SiteConfig extends DataObject implements PermissionProvider { if(!$member) $member = Member::currentUserID(); if($member && is_numeric($member)) $member = DataObject::get_by_id('Member', $member); + if ($member && Permission::checkMember($member, "ADMIN")) return true; + // check for any logged-in users if(!$this->CanEditType || $this->CanEditType == 'LoggedInUsers' && $member) return true; @@ -273,6 +277,8 @@ class SiteConfig extends DataObject implements PermissionProvider { if (Permission::check('ADMIN')) return true; + if ($member && Permission::checkMember($member, "ADMIN")) return true; + // check for any logged-in users if($this->CanCreateTopLevelType == 'LoggedInUsers' && $member) return true;