From fd81f964e25faa0c6a646fa06ce3b322c58bc904 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Thu, 14 Nov 2013 15:00:16 +1300 Subject: [PATCH] NEW make DMSDocument 'can' functions extensible --- code/DMSDocument.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/code/DMSDocument.php b/code/DMSDocument.php index 4cbd478..56ebcaa 100755 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -38,21 +38,31 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { public function canView($member = null) { + $canView = false; if($member == null) $member = Member::currentUser(); if($member->ID){ - return true; + $canView = true; } + + $this->extend('canView', $canView); + return $canView; } public function canEdit($member = null) { - return $this->canView(); + $canEdit = $this->canView(); + $this->extend('canEdit', $canEdit); + return $canEdit; } public function canCreate($member = null) { - return $this->canView(); + $canCreate = $this->canView(); + $this->extend('canCreate', $canCreate); + return $canCreate; } public function canDelete($member = null) { - return $this->canView(); + $canDelete = $this->canView(); + $this->extend('canDelete', $canDelete); + return $canDelete; }