From 189bc062b3feb0e51e798b65948e5563ce552abe Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 30 Sep 2021 16:17:48 +0800 Subject: [PATCH] * Fix bug#15363 --- module/common/model.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/module/common/model.php b/module/common/model.php index 0fee18a258..4bcd62386f 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -674,6 +674,23 @@ class commonModel extends model } } + /* Check whether other methods under the module have permissions. If yes, point to other methods. */ + if($display == false and isset($lang->$currentModule->menu)) + { + foreach($lang->$currentModule->menu as $menu) + { + $linkPart = explode('|', $menu['link']); + if(isset($linkPart[2])) $method = $linkPart[2]; + else continue; + if(common::hasPriv($currentModule, $method)) + { + $display = true; + $currentMethod = $method; + if(!isset($menu['target'])) break; // Try to jump to the method without opening a new window. + } + } + } + if(!$display) continue; /* Assign vars. */