From 3276320234f06859f34d21827b41a44c7cbd435a Mon Sep 17 00:00:00 2001 From: Cam Findlay Date: Thu, 18 Apr 2013 13:02:32 +1200 Subject: [PATCH] Added CRUD settings to allow non-admin CMS users to use parts of the dmx module. --- code/DMSDocument.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/code/DMSDocument.php b/code/DMSDocument.php index 8495127..35e3e32 100755 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -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.