添加对于用户的组织、角色分配

This commit is contained in:
2026-10-30 15:43:03 +08:00
parent 8546afa24e
commit f4f24398ee
23 changed files with 489 additions and 58 deletions
@@ -0,0 +1,15 @@
-- 系统管理员补齐全部顶部栏目。可重复执行,已有的不会重复插入。
INSERT INTO sys_role_menu (role_id, menu_code)
SELECT r.id, m.code
FROM sys_role r
CROSS JOIN (
VALUES ('dashboard'), ('search'), ('hotwords'), ('special'),
('deposit'), ('analysis'), ('resource'), ('collect'),
('governance'), ('admin')
) AS m(code)
WHERE r.deleted = 0
AND upper(r.code) = 'ADMIN'
AND NOT EXISTS (
SELECT 1 FROM sys_role_menu x WHERE x.role_id = r.id AND x.menu_code = m.code
);