From abc6d707e505e65d0a360a5ceb0160f43d111e5a Mon Sep 17 00:00:00 2001 From: chaideqing Date: Mon, 10 Jul 2023 07:12:59 +0000 Subject: [PATCH] * Fix bug#36154. --- module/doc/control.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/doc/control.php b/module/doc/control.php index 1aeeab5d10..8baf45dd3f 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -380,11 +380,13 @@ class doc extends control $doclib = $this->loadModel('doc')->getLibById($libID); $canVisit = true; + if(!empty($doclib->groups)) $groupAccounts = $this->loadModel('group')->getGroupAccounts(explode(',', $doclib->groups)); + switch($objectType) { case 'custom': $account = (string)$this->app->user->account; - if(($doclib->acl == 'custom' or $doclib->acl == 'private') and strpos($doclib->users, $account) === false and $doclib->addedBy !== $account) $canVisit = false; + if(($doclib->acl == 'custom' or $doclib->acl == 'private') and strpos($doclib->users, $account) === false and $doclib->addedBy !== $account and !(isset($groupAccounts) and in_array($account, $groupAccounts, true))) $canVisit = false; break; case 'product': $canVisit = $this->loadModel('product')->checkPriv($doclib->product);