Merge pull request #38 from normann/master

NEW make DMSDocument 'can' functions extensible
This commit is contained in:
Stephen Shkardoon 2013-11-13 18:18:13 -08:00
commit 8bd8ed51a3

View File

@ -38,21 +38,31 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
public function canView($member = null) { public function canView($member = null) {
$canView = false;
if($member == null) $member = Member::currentUser(); if($member == null) $member = Member::currentUser();
if($member->ID){ if($member->ID){
return true; $canView = true;
} }
$this->extend('canView', $canView);
return $canView;
} }
public function canEdit($member = null) { public function canEdit($member = null) {
return $this->canView(); $canEdit = $this->canView();
$this->extend('canEdit', $canEdit);
return $canEdit;
} }
public function canCreate($member = null) { public function canCreate($member = null) {
return $this->canView(); $canCreate = $this->canView();
$this->extend('canCreate', $canCreate);
return $canCreate;
} }
public function canDelete($member = null) { public function canDelete($member = null) {
return $this->canView(); $canDelete = $this->canView();
$this->extend('canDelete', $canDelete);
return $canDelete;
} }