From b3fcd130cc22480da95bf874df8b10a9a0dacc63 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 14 May 2024 15:47:46 +0800 Subject: [PATCH] * Add check feedback toStory priv to bug isClickable. --- module/bug/model.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/bug/model.php b/module/bug/model.php index 1e3006df48..93f1ac873c 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1824,6 +1824,8 @@ class bugModel extends model */ public static function isClickable(object $object, string $action, string $module = 'bug'): bool { + global $config; + $action = strtolower($action); /* 如果bug状态是激活,没有确认过,这个bug可以被确认。 */ @@ -1844,6 +1846,9 @@ class bugModel extends model /* 如果bug是激活状态,这个bug可以被转为需求。 */ /* If the status is active, the bug can be toStory. */ if($module == 'bug' && $action == 'tostory') return $object->status == 'active'; + /* 判断反馈转bug操作按钮的权限。 */ + /* check feedback toStory priv. */ + if($module == 'bug' && $action == 'create') return ($config->global->flow == 'full' || $config->global->flow == 'onlyTest') && strpos('closed|clarify|noreview', $object->status) === false; return true; }