diff options
| author | Spp <spp@jorge.gr> | 2013-09-02 11:24:09 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2013-09-02 11:24:09 +0200 |
| commit | 1bccf67c097850dd7dccc92497e79ab0d88fd1e0 (patch) | |
| tree | 2dccc8127f1abd3b36404c8386a0134a76726249 /sql | |
| parent | fced8a896e2c22e95bdbf853898671f10f746277 (diff) | |
Core/RBAC: Move gm commands to RBAC (using individual permissions)
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/updates/auth/2013_09_02_05_auth_misc.sql | 23 | ||||
| -rw-r--r-- | sql/updates/world/2013_09_02_06_world_command.sql | 11 |
2 files changed, 34 insertions, 0 deletions
diff --git a/sql/updates/auth/2013_09_02_05_auth_misc.sql b/sql/updates/auth/2013_09_02_05_auth_misc.sql new file mode 100644 index 00000000000..8d71ab530dd --- /dev/null +++ b/sql/updates/auth/2013_09_02_05_auth_misc.sql @@ -0,0 +1,23 @@ +/* cs_gm.cpp */ + +SET @id = 371; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+5; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'gm'), +(@id+1, 'gm chat'), +(@id+2, 'gm fly'), +(@id+3, 'gm ingame'), +(@id+4, 'gm list'), +(@id+5, 'gm visible'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+5; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(2, @id+0), +(2, @id+1), +(4, @id+2), +(2, @id+3), +(4, @id+4), +(2, @id+5); diff --git a/sql/updates/world/2013_09_02_06_world_command.sql b/sql/updates/world/2013_09_02_06_world_command.sql new file mode 100644 index 00000000000..fe033e544ea --- /dev/null +++ b/sql/updates/world/2013_09_02_06_world_command.sql @@ -0,0 +1,11 @@ +/* cs_gm.cpp */ + +SET @id = 371; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'gm'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'gm chat'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'gm fly'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'gm ingame'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'gm list'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'gm visible'; |
