Permalink
Browse files

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
  • Loading branch information...
1 parent 04df917 commit e57be3f6e412edcb7e70e87d132e494b6a048636 sminnee committed with chillu Oct 15, 2009
Showing with 6 additions and 0 deletions.
  1. +6 −0 code/model/SiteConfig.php
@@ -217,6 +217,8 @@ public function canView($member = null) {
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 @@ public function canEdit($member = null) {
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 @@ public function canCreateTopLevel($member = null) {
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;

0 comments on commit e57be3f

Please sign in to comment.