Skip to content

Commit

Permalink
支持角色权限配置
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxinwang committed May 4, 2023
1 parent d9bb737 commit 1c59b48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,13 @@ INSERT INTO `metrics` (`key`,`name`,`unit`,`created_at`,`updated_at`) VALUES ('S
INSERT INTO `metrics` (`key`,`name`,`unit`,`created_at`,`updated_at`) VALUES ('THREADS_CONNECTED','连接数使用率','%',now(),now());
INSERT INTO `metrics` (`key`,`name`,`unit`,`created_at`,`updated_at`) VALUES ('THREADS_RUNNING_NUM','并发线程数','',now(),now());
INSERT INTO `metrics` (`key`,`name`,`unit`,`created_at`,`updated_at`) VALUES ('TPS','事务数','个/秒',now(),now());
-- insert menus
INSERT INTO `menus` (`id`,`name`,`parent_id`,`meta`,`component`,`redirect`,`path`,`created_at`,`updated_at`,`action_data`,`action_list`) VALUES (1,'instance',0,'{\"icon\": \"table\", \"show\": true, \"title\": \"menu.instance\"}','RouteView','/instance/list',NULL,'2023-04-17 15:32:49','2023-05-04 16:29:15','[]','[]');
INSERT INTO `menus` (`id`,`name`,`parent_id`,`meta`,`component`,`redirect`,`path`,`created_at`,`updated_at`,`action_data`,`action_list`) VALUES (2,'system',0,'{\"icon\": \"table\", \"show\": true, \"title\": \"menu.system\"}','RouteView','/system/user',NULL,'2023-04-17 15:32:49','2023-05-04 16:29:15','[]','[]');
INSERT INTO `menus` (`id`,`name`,`parent_id`,`meta`,`component`,`redirect`,`path`,`created_at`,`updated_at`,`action_data`,`action_list`) VALUES (1001,'instanceList',1,'{\"icon\": \"table\", \"show\": true, \"title\": \"menu.instance.list\"}','InstanceList',NULL,'/instance/list','2023-04-17 15:32:49','2023-05-04 16:29:15','[{\"action\": \"add\", \"describe\": \"新增\", \"defaultCheck\": false}, {\"action\": \"query\", \"describe\": \"查询\", \"defaultCheck\": false}, {\"action\": \"edit\", \"describe\": \"修改\", \"defaultCheck\": false}, {\"action\": \"delete\", \"describe\": \"删除\", \"defaultCheck\": false}]','[\"add\", \"query\", \"edit\", \"delete\"]');
INSERT INTO `menus` (`id`,`name`,`parent_id`,`meta`,`component`,`redirect`,`path`,`created_at`,`updated_at`,`action_data`,`action_list`) VALUES (1002,'InstanceInspection',1,'{\"icon\": \"table\", \"show\": true, \"title\": \"menu.instance.inspection\"}','InstanceInspection',NULL,'/instance/inspection','2023-04-17 15:32:49','2023-05-04 16:29:15','[{\"action\": \"get\", \"describe\": \"详情\", \"defaultCheck\": false}, {\"action\": \"query\", \"describe\": \"查询\", \"defaultCheck\": false}]','[\"get\", \"query\"]');
INSERT INTO `menus` (`id`,`name`,`parent_id`,`meta`,`component`,`redirect`,`path`,`created_at`,`updated_at`,`action_data`,`action_list`) VALUES (2001,'SystemUser',2,'{\"icon\": \"table\", \"show\": true, \"title\": \"menu.system.user\"}','SystemUser',NULL,'/system/user','2023-04-17 15:32:49','2023-05-04 16:29:53','[{\"action\": \"add\", \"describe\": \"新增\", \"defaultCheck\": false}, {\"action\": \"query\", \"describe\": \"查询\", \"defaultCheck\": false}, {\"action\": \"edit\", \"describe\": \"修改\", \"defaultCheck\": false}, {\"action\": \"delete\", \"describe\": \"删除\", \"defaultCheck\": false}, {\"action\": \"resetPassword\", \"describe\": \"重置密码\", \"defaultCheck\": false}]','[\"add\", \"query\", \"edit\", \"delete\", \"resetPassword\"]');
INSERT INTO `menus` (`id`,`name`,`parent_id`,`meta`,`component`,`redirect`,`path`,`created_at`,`updated_at`,`action_data`,`action_list`) VALUES (2002,'SystemRole',2,'{\"icon\": \"table\", \"show\": true, \"title\": \"menu.system.role\"}','SystemRole',NULL,'/system/role','2023-04-17 15:32:49','2023-05-04 16:29:53','[{\"action\": \"add\", \"describe\": \"新增\", \"defaultCheck\": false}, {\"action\": \"query\", \"describe\": \"查询\", \"defaultCheck\": false}, {\"action\": \"edit\", \"describe\": \"修改\", \"defaultCheck\": false}, {\"action\": \"delete\", \"describe\": \"删除\", \"defaultCheck\": false}, {\"action\": \"funcPerms\", \"describe\": \"功能权限\", \"defaultCheck\": false}]','[\"add\", \"query\", \"edit\", \"delete\", \"funcPerms\"]');
-- insert admin role permissions (ALL menu)
INSERT IGNORE INTO role_permissions(role_id, menu_id, action_data, action_list)
SELECT 'admin' AS role_id, id AS menu_id, action_data, action_list FROM menus;

0 comments on commit 1c59b48

Please sign in to comment.