mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
BUGFIX More solid checks in Subsite permission methods to deal with non-existing members
This commit is contained in:
parent
d373b09908
commit
83fb26cc3e
@ -343,7 +343,9 @@ JS;
|
||||
* @return DataObjectSet Subsite instances
|
||||
*/
|
||||
static function getSubsitesForMember( $member = null) {
|
||||
if(!$member) $member = Member::currentMember();
|
||||
if(!$member && $member !== FALSE) $member = Member::currentMember();
|
||||
|
||||
if(!$member) return false;
|
||||
|
||||
if(self::hasMainSitePermission($member)) {
|
||||
return DataObject::get('Subsite');
|
||||
@ -363,7 +365,9 @@ JS;
|
||||
if(!is_array($permissionCodes))
|
||||
user_error('Permissions must be passed to Subsite::hasMainSitePermission as an array', E_USER_ERROR);
|
||||
|
||||
if(!$member) $member = Member::currentMember();
|
||||
if(!$member && $member !== FALSE) $member = Member::currentMember();
|
||||
|
||||
if(!$member) return false;
|
||||
|
||||
if(Permission::checkMember($member->ID, "ADMIN")) return true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user