aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2013-09-02 11:33:45 +0200
committerSpp <spp@jorge.gr>2013-09-02 11:33:45 +0200
commit29c57c3447393e14079c07ee6b5fb5f07876a5c0 (patch)
treecb989b4457b2d2267e8ed7ad6cc653b1b962f040 /sql
parent1bccf67c097850dd7dccc92497e79ab0d88fd1e0 (diff)
Core/RBAC: Move go commands to RBAC (using individual permissions)
Diffstat (limited to 'sql')
-rw-r--r--sql/updates/auth/2013_09_02_06_auth_misc.sql31
-rw-r--r--sql/updates/world/2013_09_02_07_world_command.sql15
2 files changed, 46 insertions, 0 deletions
diff --git a/sql/updates/auth/2013_09_02_06_auth_misc.sql b/sql/updates/auth/2013_09_02_06_auth_misc.sql
new file mode 100644
index 00000000000..e66e4d30db1
--- /dev/null
+++ b/sql/updates/auth/2013_09_02_06_auth_misc.sql
@@ -0,0 +1,31 @@
+/* cs_go.cpp */
+
+SET @id = 377;
+
+-- Add new permissions
+DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+9;
+INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
+(@id+0, 'go'),
+(@id+1, 'go creature'),
+(@id+2, 'go graveyard'),
+(@id+3, 'go grid'),
+(@id+4, 'go object'),
+(@id+5, 'go taxinode'),
+(@id+6, 'go ticket'),
+(@id+7, 'go trigger'),
+(@id+8, 'go xyz'),
+(@id+9, 'go zonexy');
+
+-- 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),
+(2, @id+1),
+(2, @id+2),
+(2, @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_07_world_command.sql b/sql/updates/world/2013_09_02_07_world_command.sql
new file mode 100644
index 00000000000..58350a6c729
--- /dev/null
+++ b/sql/updates/world/2013_09_02_07_world_command.sql
@@ -0,0 +1,15 @@
+/* cs_go.cpp */
+
+SET @id = 371;
+
+-- Update command table with new RBAC permissions
+UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'go';
+UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'go creature';
+UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'go graveyard';
+UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'go grid';
+UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'go object';
+UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'go taxinode';
+UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'go ticket';
+UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'go trigger';
+UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'go xyz';
+UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'go zonexy');