mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Allowing to pass $member parameter into Member->canEdit()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66680 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
47a67a5a4e
commit
b65f74a37f
@ -892,10 +892,12 @@ class Member extends DataObject {
|
||||
}
|
||||
}
|
||||
|
||||
function canEdit() {
|
||||
if( $this->ID == Member::currentUserID() ) return true;
|
||||
function canEdit($member = null) {
|
||||
if(!$member && $member !== FALSE) $member = Member::currentUser();
|
||||
|
||||
return Permission::check( 'ADMIN' );
|
||||
if($this->ID == Member::currentUserID()) return true;
|
||||
|
||||
return Permission::check('ADMIN');
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user