Added CRUD settings to allow non-admin CMS users to use parts of the dmx module.

This commit is contained in:
Cam Findlay 2013-04-18 13:02:32 +12:00
parent 2c96aada8a
commit 3276320234
1 changed files with 22 additions and 0 deletions

View File

@ -35,6 +35,28 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
static $singular_name = 'Document';
static $plural_name = 'Documents';
public function canView($member = null) {
if($member == null) $member = Member::currentUser();
if($member->ID){
return true;
}
}
public function canEdit($member = null) {
return $this->canView();
}
public function canCreate($member = null) {
return $this->canView();
}
public function canDelete($member = null) {
return $this->canView();
}
/**
* Associates this document with a Page. This method does nothing if the association already exists.