diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 018f02e72..f6cb4e15c 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -1794,8 +1794,6 @@ class DataObject extends ViewableData implements DataObjectInterface { if(!isset($permissionCache[$memberID][$perm])) { if($member->ID) { $groups = $member->Groups(); - } else { - $groups = DataObject::get("Group_Unsecure", ""); } $groupList = implode(', ', $groups->column("ID")); diff --git a/security/Group.php b/security/Group.php index d43ef21fc..0fbcec568 100644 --- a/security/Group.php +++ b/security/Group.php @@ -298,11 +298,4 @@ class Group extends DataObject { } } -/** - * A group representing everyone, including users not logged in. - * @package sapphire - * @subpackage security - */ -class Group_Unsecure extends Group { -} -?> +?> \ No newline at end of file diff --git a/security/Member.php b/security/Member.php index df5b54ef5..8c079d949 100644 --- a/security/Member.php +++ b/security/Member.php @@ -635,18 +635,13 @@ class Member extends DataObject { */ public function Groups() { $groups = $this->getManyManyComponents("Groups"); - - $unsecure = DataObject::get("Group_Unsecure"); - if($unsecure) { - foreach($unsecure as $unsecureItem) { - $groups->push($unsecureItem); - } - } - $groupIDs = $groups->column(); $collatedGroups = array(); - foreach($groups as $group) { - $collatedGroups = array_merge((array)$collatedGroups, $group->collateAncestorIDs()); + + if($groups) { + foreach($groups as $group) { + $collatedGroups = array_merge((array)$collatedGroups, $group->collateAncestorIDs()); + } } $table = "Group_Members"; @@ -666,8 +661,7 @@ class Member extends DataObject { $result = new Member_GroupSet(); } - $result->setComponentInfo("many-to-many", $this, "Member", $table, - "Group"); + $result->setComponentInfo("many-to-many", $this, "Member", $table, "Group"); return $result; }