diff --git a/module/ai/model.php b/module/ai/model.php index a2931b897a..20757d255f 100644 --- a/module/ai/model.php +++ b/module/ai/model.php @@ -1112,7 +1112,8 @@ class aiModel extends model return $this->dao->select('*')->from(TABLE_PROMPT) ->where('deleted')->eq(0) ->andWhere('module')->eq($module) - ->andWhere('status', true)->eq('active')->orWhere('createdBy')->eq($this->app->user->account)->markRight(1) + ->beginIF(!common::hasPriv('ai', 'promptaudit'))->andWhere('status')->eq('active')->fi() // Only show active prompts to non-auditors. + ->beginIF(common::hasPriv('ai', 'promptaudit'))->andWhere('status', true)->eq('active')->orWhere('createdBy')->eq($this->app->user->account)->markRight(1)->fi() ->orderBy('id_desc') ->fetchAll(); } diff --git a/module/ai/view/promptmenu.html.php b/module/ai/view/promptmenu.html.php index 2e916a30a7..d63a44163b 100644 --- a/module/ai/view/promptmenu.html.php +++ b/module/ai/view/promptmenu.html.php @@ -13,6 +13,7 @@ * @link https://www.zentao.net */ ?> + app->loadConfig('ai'); $module = $this->app->getModuleName(); @@ -70,4 +71,4 @@ }); - +