From 29c57c3447393e14079c07ee6b5fb5f07876a5c0 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 2 Sep 2013 11:33:45 +0200 Subject: Core/RBAC: Move go commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_02_06_auth_misc.sql | 31 +++++++++++++++++++++++ sql/updates/world/2013_09_02_07_world_command.sql | 15 +++++++++++ 2 files changed, 46 insertions(+) create mode 100644 sql/updates/auth/2013_09_02_06_auth_misc.sql create mode 100644 sql/updates/world/2013_09_02_07_world_command.sql (limited to 'sql/updates') diff --git a/sql/updates/auth/2013_09_02_06_auth_misc.sql b/sql/updates/auth/2013_09_02_06_auth_misc.sql new file mode 100644 index 00000000000..e66e4d30db1 --- /dev/null +++ b/sql/updates/auth/2013_09_02_06_auth_misc.sql @@ -0,0 +1,31 @@ +/* cs_go.cpp */ + +SET @id = 377; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+9; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'go'), +(@id+1, 'go creature'), +(@id+2, 'go graveyard'), +(@id+3, 'go grid'), +(@id+4, 'go object'), +(@id+5, 'go taxinode'), +(@id+6, 'go ticket'), +(@id+7, 'go trigger'), +(@id+8, 'go xyz'), +(@id+9, 'go zonexy'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+9; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(2, @id+0), +(2, @id+1), +(2, @id+2), +(2, @id+3), +(2, @id+4), +(2, @id+5), +(2, @id+6), +(2, @id+7), +(2, @id+8), +(2, @id+9); diff --git a/sql/updates/world/2013_09_02_07_world_command.sql b/sql/updates/world/2013_09_02_07_world_command.sql new file mode 100644 index 00000000000..58350a6c729 --- /dev/null +++ b/sql/updates/world/2013_09_02_07_world_command.sql @@ -0,0 +1,15 @@ +/* cs_go.cpp */ + +SET @id = 371; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'go'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'go creature'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'go graveyard'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'go grid'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'go object'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'go taxinode'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'go ticket'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'go trigger'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'go xyz'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'go zonexy'); -- cgit v1.2.3