From 76bb674a57a8cfecd504d4437b96c50ce59f314e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 21 Aug 2014 21:33:00 +0200 Subject: [PATCH] set accessobj for view (Closes Bug #168) --- out/out.ApproveDocument.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/out/out.ApproveDocument.php b/out/out.ApproveDocument.php index cfec5d11b..3cb0c7ffb 100644 --- a/out/out.ApproveDocument.php +++ b/out/out.ApproveDocument.php @@ -23,6 +23,7 @@ include("../inc/inc.Utils.php"); include("../inc/inc.DBInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.ClassUI.php"); +include("../inc/inc.ClassAccessOperation.php"); include("../inc/inc.Authentication.php"); if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) { @@ -37,6 +38,9 @@ if (!is_object($document)) { $folder = $document->getFolder(); +/* Create object for checking access to certain operations */ +$accessop = new SeedDMS_AccessOperation($document, $user, $settings); + if ($document->getAccessMode($user) < M_READ) { UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied")); } @@ -68,6 +72,7 @@ if(!$approvals) { $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document)); if($view) { + $view->setParam('accessobject', $accessop); $view->show(); exit; }