mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
f71bf7d804
commit
48c0418840
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user