mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 12:05:56 +00:00
Merge pull request #38 from normann/master
NEW make DMSDocument 'can' functions extensible
This commit is contained in:
commit
8bd8ed51a3
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user