From ab0572e7cc9cc0c2288c8111032a052265a75407 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Fri, 21 Aug 2015 09:16:46 +0100 Subject: [PATCH] DOCS Permission comments made a bit clearer --- security/Permission.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/security/Permission.php b/security/Permission.php index 846154416..16498a529 100644 --- a/security/Permission.php +++ b/security/Permission.php @@ -163,8 +163,7 @@ class Permission extends DataObject implements TemplateGlobalProvider { $memberID = (is_object($member)) ? $member->ID : $member; } - // If $admin_implies_all was false then this would be inefficient, but that's an edge - // case and this keeps the code simpler + // Turn the code into an array as we may need to add other permsissions to the set we check if(!is_array($code)) $code = array($code); if($arg == 'any') { @@ -179,6 +178,8 @@ class Permission extends DataObject implements TemplateGlobalProvider { break; } } + + // if ADMIN has all privileges, then we need to push that code in if(Config::inst()->get('Permission', 'admin_implies_all')) $code[] = "ADMIN"; // Multiple $code values - return true if at least one matches, ie, intersection exists