aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2013-09-02 09:39:35 +0200
committerSpp <spp@jorge.gr>2013-09-02 10:01:34 +0200
commit33d9da5060e4402f646a6592e089133e2414e38f (patch)
treeaf414a129359859197dad328e330e57848855ae6 /sql
parent59667ee6069915613ca31947d539724dc4edf0a8 (diff)
Core/RBAC: Move cheat commands to RBAC (using individual permissions)
Diffstat (limited to 'sql')
-rw-r--r--sql/updates/auth/2013_09_02_00_auth_misc.sql29
-rw-r--r--sql/updates/world/2013_09_02_01_world_command.sql14
2 files changed, 43 insertions, 0 deletions
diff --git a/sql/updates/auth/2013_09_02_00_auth_misc.sql b/sql/updates/auth/2013_09_02_00_auth_misc.sql
new file mode 100644
index 00000000000..46a8054e086
--- /dev/null
+++ b/sql/updates/auth/2013_09_02_00_auth_misc.sql
@@ -0,0 +1,29 @@
+/* cs_cheat.cpp */
+
+SET @id = 291;
+
+-- Add new permissions
+DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+8;
+INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
+(@id+0, 'cheat'),
+(@id+1, 'cheat casttime'),
+(@id+2, 'cheat cooldown'),
+(@id+3, 'cheat explore'),
+(@id+4, 'cheat god'),
+(@id+5, 'cheat power'),
+(@id+6, 'cheat status'),
+(@id+7, 'cheat taxi'),
+(@id+8, 'cheat waterwalk');
+
+-- Add permissions to "corresponding Commands Role"
+DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+8;
+INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES
+(4, @id+0),
+(4, @id+1),
+(4, @id+2),
+(4, @id+3),
+(4, @id+4),
+(4, @id+5),
+(4, @id+6),
+(4, @id+7),
+(4, @id+8);
diff --git a/sql/updates/world/2013_09_02_01_world_command.sql b/sql/updates/world/2013_09_02_01_world_command.sql
new file mode 100644
index 00000000000..aab76efa562
--- /dev/null
+++ b/sql/updates/world/2013_09_02_01_world_command.sql
@@ -0,0 +1,14 @@
+/* cs_cheat.cpp */
+
+SET @id = 291;
+
+-- Update command table with new RBAC permissions
+UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'cheat';
+UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'cheat casttime';
+UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'cheat cooldown';
+UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'cheat explore';
+UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'cheat god';
+UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'cheat power';
+UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'cheat status';
+UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'cheat taxi';
+UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'cheat waterwalk';