diff options
| author | Spp <spp@jorge.gr> | 2013-09-02 13:01:50 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2013-09-02 13:01:50 +0200 |
| commit | f68471f1420bbf15b705f4ad0d93c77fc892d047 (patch) | |
| tree | c027d4776c6aafe8b3f257e9a4787935bb77b09e /sql/updates | |
| parent | 2d508387e5cf0910186cdb160cd58181d5715a49 (diff) | |
Core/RBAC: Move message commands to RBAC (using individual permissions)
Diffstat (limited to 'sql/updates')
| -rw-r--r-- | sql/updates/auth/2013_09_02_15_auth_misc.sql | 31 | ||||
| -rw-r--r-- | sql/updates/world/2013_09_02_16_world_command.sql | 15 |
2 files changed, 46 insertions, 0 deletions
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'); |
