From af5f8653abadf9405839be52bc41436ecd2e326b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 18 Jun 2014 02:53:33 +0000 Subject: [PATCH] * finish task #1874. --- module/doc/control.php | 5 ++++- module/project/view/task.html.php | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index c5d7355480..d529830939 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -375,7 +375,10 @@ class doc extends control /* Get doc. */ $doc = $this->doc->getById($docID, true); if(!$doc) die(js::error($this->lang->notFound) . js::locate('back')); - if($doc->project != 0 and !$this->project->checkPriv($this->project->getById($doc->project))) + + /* Check priv when lib is product or project. */ + $systemLib = ($doc->lib == 'project' or $doc->lib == 'product') ? $doc->lib : ''; + if($systemLib and !$this->{$systemLib}->checkPriv($this->{$systemLib}->getById($doc->{$systemLib}))) { echo(js::alert($this->lang->error->accessDenied)); die(js::locate('back')); diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 8b7a501c09..508edf1c16 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -16,9 +16,7 @@ - +