diff --git a/security/Security.php b/security/Security.php index 154196084..e4723a4b1 100644 --- a/security/Security.php +++ b/security/Security.php @@ -605,7 +605,8 @@ class Security extends Controller { $permission = DataObject::get_one("Permission", "\"Code\" = 'ADMIN'", true, "\"Permission\".\"ID\""); $adminGroup = null; - if($permission) $adminGroup = DataObject::get_one("Group", "\"Group\".\"ID\" = '{$permission->GroupID}'", true, "\"Group\".\"ID\""); + $subsiteCheck = class_exists('GroupSubsites') ? ' AND "Group"."SubsiteID" = 0' : ''; + if($permission) $adminGroup = DataObject::get_one("Group", "\"Group\".\"ID\" = '{$permission->GroupID}'$subsiteCheck", true, "\"Group\".\"ID\""); if($adminGroup) { if($adminGroup->Members()->First()) { @@ -857,4 +858,4 @@ class Security extends Controller { } } -?> \ No newline at end of file +?>