diff options
| author | Spp <spp@jorge.gr> | 2013-09-02 11:58:14 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2013-09-02 11:58:14 +0200 |
| commit | 2625e78f8089e0bea57bbeffaf77e1b9a2c96a6b (patch) | |
| tree | f0e5b26550eb06ff51d762861ff76c77c981a4da /sql/updates | |
| parent | 08ef6bd9f8c76c0606818cb66c4754a28f185e25 (diff) | |
Core/RBAC: Move instance commands to RBAC (using individual permissions)
Diffstat (limited to 'sql/updates')
| -rw-r--r-- | sql/updates/auth/2013_09_02_10_auth_misc.sql | 21 | ||||
| -rw-r--r-- | sql/updates/world/2013_09_02_11_world_command.sql | 10 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sql/updates/auth/2013_09_02_10_auth_misc.sql b/sql/updates/auth/2013_09_02_10_auth_misc.sql new file mode 100644 index 00000000000..a69174d6ca3 --- /dev/null +++ b/sql/updates/auth/2013_09_02_10_auth_misc.sql @@ -0,0 +1,21 @@ +/* cs_instance.cpp */ + +SET @id = 412; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+4; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'instance'), +(@id+1, 'instance listbinds'), +(@id+2, 'instance unbind'), +(@id+3, 'instance stats'), +(@id+4, 'instance savedata'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+4; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(2, @id+0), +(2, @id+1), +(2, @id+2), +(2, @id+3), +(2, @id+4); diff --git a/sql/updates/world/2013_09_02_11_world_command.sql b/sql/updates/world/2013_09_02_11_world_command.sql new file mode 100644 index 00000000000..c134fb703e6 --- /dev/null +++ b/sql/updates/world/2013_09_02_11_world_command.sql @@ -0,0 +1,10 @@ +/* cs_instance.cpp */ + +SET @id = 408; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'instance'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'instance listbinds'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'instance unbind'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'instance stats'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'instance savedata'; |
