BUGFIX More robust checks on the current member in Member::canEdit() and Member::canDelete() if there is no logged in member (from r92129)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92458 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 01:43:16 +00:00
parent f71bf7d804
commit 48c0418840

View File

@ -998,6 +998,9 @@ class Member extends DataObject {
$results = $this->extend('canEdit', $member);
if($results && is_array($results)) if(!min($results)) return false;
// No member found
if(!($member && $member->exists())) return false;
return $this->canView($member);
}
@ -1012,6 +1015,9 @@ class Member extends DataObject {
$results = $this->extend('canDelete', $member);
if($results && is_array($results)) if(!min($results)) return false;
// No member found
if(!($member && $member->exists())) return false;
return $this->canEdit($member);
}