From f68471f1420bbf15b705f4ad0d93c77fc892d047 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 2 Sep 2013 13:01:50 +0200 Subject: Core/RBAC: Move message commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_02_15_auth_misc.sql | 31 +++++++++++++++++++++++ sql/updates/world/2013_09_02_16_world_command.sql | 15 +++++++++++ 2 files changed, 46 insertions(+) create mode 100644 sql/updates/auth/2013_09_02_15_auth_misc.sql create mode 100644 sql/updates/world/2013_09_02_16_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_02_15_auth_misc.sql b/sql/updates/auth/2013_09_02_15_auth_misc.sql new file mode 100644 index 00000000000..91ee22923db --- /dev/null +++ b/sql/updates/auth/2013_09_02_15_auth_misc.sql @@ -0,0 +1,31 @@ +/* cs_message.cpp */ + +SET @id = 458; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+9; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'announce'), +(@id+1, 'channel'), +(@id+2, 'channel set'), +(@id+3, 'channel set ownership'), +(@id+4, 'gmannounce'), +(@id+5, 'gmnameannounce'), +(@id+6, 'gmnotify'), +(@id+7, 'nameannounce'), +(@id+8, 'notify'), +(@id+9, 'whispers'); + +-- 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), +(4, @id+1), +(4, @id+2), +(4, @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_16_world_command.sql b/sql/updates/world/2013_09_02_16_world_command.sql new file mode 100644 index 00000000000..d283363203e --- /dev/null +++ b/sql/updates/world/2013_09_02_16_world_command.sql @@ -0,0 +1,15 @@ +/* cs_message.cpp */ + +SET @id = 458; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'announce'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'channel'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'channel set'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'channel set ownership'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'gmannounce'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'gmnameannounce'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'gmnotify'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'nameannounce'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'notify'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'whispers'); -- cgit v1.2.3