From ff9b3486c555a09dec222309fee5ada2e74d4cdb Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 20 Apr 2015 13:44:13 +0200 Subject: [PATCH] add maySetRecipients() --- inc/inc.ClassAccessOperation.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/inc/inc.ClassAccessOperation.php b/inc/inc.ClassAccessOperation.php index c2064796c..643aaf13f 100644 --- a/inc/inc.ClassAccessOperation.php +++ b/inc/inc.ClassAccessOperation.php @@ -105,6 +105,26 @@ class SeedDMS_AccessOperation { return false; } /* }}} */ + /** + * Check if recipients may be edited + * + * This check can only be done for documents. Setting the document + * recipients is only allowed if version modification is turned on + * in the settings. The + * admin may even set reviewers/approvers if is disallowed in the + * settings. + */ + function maySetRecipients() { /* {{{ */ + if(get_class($this->obj) == 'SeedDMS_Core_Document') { + $latestContent = $this->obj->getLatestContent(); + $status = $latestContent->getStatus(); + if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin())) { + return true; + } + } + return false; + } /* }}} */ + /** * Check if workflow may be edited *