* check for priv prior to executing and auditing prompts.
This commit is contained in:
+2
-1
@@ -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();
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php if(commonModel::hasPriv('ai', 'executePrompt')):?>
|
||||
<?php
|
||||
$this->app->loadConfig('ai');
|
||||
$module = $this->app->getModuleName();
|
||||
@@ -70,4 +71,4 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php endif; endif;?>
|
||||
<?php endif; endif; endif;?>
|
||||
|
||||
Reference in New Issue
Block a user