diff --git a/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/controller/AiragMcpController.java b/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/controller/AiragMcpController.java index 0175989cf..65094d6e6 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/controller/AiragMcpController.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/controller/AiragMcpController.java @@ -162,7 +162,7 @@ public class AiragMcpController extends JeecgController queryById(@RequestParam(name = "id", required = true) String id) { AiragMcp airagMcp = airagMcpService.getById(id); diff --git a/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/prompts/controller/AiragPromptsController.java b/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/prompts/controller/AiragPromptsController.java index 8d55c7bb6..b6a4f72aa 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/prompts/controller/AiragPromptsController.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/prompts/controller/AiragPromptsController.java @@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.constant.CommonConstant; @@ -47,6 +48,7 @@ public class AiragPromptsController extends JeecgController> queryPageList(AiragPrompts airagPrompts, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @@ -67,6 +69,7 @@ public class AiragPromptsController extends JeecgController> recycleBinList(AiragPrompts airagPrompts, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @@ -87,6 +90,7 @@ public class AiragPromptsController extends JeecgController add(@RequestBody AiragPrompts airagPrompts) { airagPrompts.setDelFlag(CommonConstant.DEL_FLAG_0); airagPrompts.setStatus("0"); @@ -103,6 +107,7 @@ public class AiragPromptsController extends JeecgController edit(@RequestBody AiragPrompts airagPrompts) { airagPromptsService.updateById(airagPrompts); return Result.OK("编辑成功!"); @@ -117,6 +122,7 @@ public class AiragPromptsController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { airagPromptsService.removeById(id); return Result.OK("删除成功!"); @@ -131,6 +137,7 @@ public class AiragPromptsController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.airagPromptsService.removeByIds(Arrays.asList(ids.split(","))); return Result.OK("批量删除成功!"); @@ -145,6 +152,7 @@ public class AiragPromptsController extends JeecgController queryById(@RequestParam(name="id",required=true) String id) { AiragPrompts airagPrompts = airagPromptsService.getById(id); if(airagPrompts==null) { @@ -158,6 +166,7 @@ public class AiragPromptsController extends JeecgController revertRecycleBin(@RequestParam(name = "ids", required = true) String ids) { airagPromptsService.revertRecycleBin(Arrays.asList(ids.split(","))); return Result.OK("已从回收站取回!"); @@ -167,6 +176,7 @@ public class AiragPromptsController extends JeecgController deleteRecycleBin(@RequestParam(name = "ids", required = true) String ids) { airagPromptsService.deleteRecycleBin(Arrays.asList(ids.split(","))); return Result.OK("从回收站彻底删除!"); @@ -178,6 +188,7 @@ public class AiragPromptsController extends JeecgController promptExperiment(@RequestBody AiragExperimentVo experimentVo, HttpServletRequest request) { return airagPromptsService.promptExperiment(experimentVo,request); } @@ -188,6 +199,7 @@ public class AiragPromptsController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, AiragPrompts.class); } diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.5_1__add_airag_prompts_button_permissions.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.5_1__add_airag_prompts_button_permissions.sql new file mode 100644 index 000000000..89c1e2dfb --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.5_1__add_airag_prompts_button_permissions.sql @@ -0,0 +1,29 @@ +-- ---author:scott---date:20260911-----for:【GHSA-6g87-g65f-9vwm】AiragPromptsController 全部端点缺失权限注解,任意普通登录用户可跨用户读取/篡改/删除/导出(含管理员)AI提示词;新增 airag:prompts:* 按钮权限并授权给系统管理员角色(parent_id=1999367175911657473 为 AI提示词菜单) + +-- 1. 新增按钮权限 +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000001', '1999367175911657473', '查询AI提示词列表', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:list', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000002', '1999367175911657473', '查询AI提示词回收站列表', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:recycleBinList', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000003', '1999367175911657473', '新增AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000004', '1999367175911657473', '编辑AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000005', '1999367175911657473', '删除AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000006', '1999367175911657473', '批量删除AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000007', '1999367175911657473', '按ID查询AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:queryById', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000008', '1999367175911657473', '从回收站取回AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:revertRecycleBin', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000009', '1999367175911657473', '从回收站彻底删除AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:deleteRecycleBin', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000010', '1999367175911657473', 'AI提示词构造器调试', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:experiment', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000011', '1999367175911657473', '导出AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); +INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('2026091100000000012', '1999367175911657473', '导入AI提示词', NULL, NULL, 0, NULL, NULL, 2, 'airag:prompts:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-09-11 10:00:00', NULL, NULL, 0, 0, '1', 0); + +-- 2. 给系统管理员角色(f6817f48af4fb3af11b9e8bf182f618b)授权 +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000021', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000001', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000022', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000002', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000023', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000003', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000024', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000004', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000025', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000005', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000026', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000006', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000027', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000007', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000028', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000008', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000029', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000009', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000030', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000010', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000031', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000011', NULL, '2026-09-11 10:00:00', '127.0.0.1'); +INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('2026091100000000032', 'f6817f48af4fb3af11b9e8bf182f618b', '2026091100000000012', NULL, '2026-09-11 10:00:00', '127.0.0.1');