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:
Ingo Schommer 2008-11-25 22:34:57 +00:00
parent 47a67a5a4e
commit b65f74a37f

View File

@ -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');
}