aboutsummaryrefslogtreecommitdiff
path: root/sql/updates
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2013-09-02 11:38:41 +0200
committerSpp <spp@jorge.gr>2013-09-02 11:38:41 +0200
commit015eee068b4bfe9af5af461ed03abab4674c358c (patch)
treebf7ac57e57b8b300bb0767f938ef7d07234a8f47 /sql/updates
parent29c57c3447393e14079c07ee6b5fb5f07876a5c0 (diff)
Core/RBAC: Move gobject commands to RBAC (using individual permissions)
Diffstat (limited to 'sql/updates')
-rw-r--r--sql/updates/auth/2013_09_02_07_auth_misc.sql37
-rw-r--r--sql/updates/world/2013_09_02_08_world_command.sql18
2 files changed, 55 insertions, 0 deletions
diff --git a/sql/updates/auth/2013_09_02_07_auth_misc.sql b/sql/updates/auth/2013_09_02_07_auth_misc.sql
new file mode 100644
index 00000000000..3fb2b343b9b
--- /dev/null
+++ b/sql/updates/auth/2013_09_02_07_auth_misc.sql
@@ -0,0 +1,37 @@
+/* cs_gobject.cpp */
+
+SET @id = 387;
+
+-- Add new permissions
+DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+12;
+INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
+(@id+0, 'gobject'),
+(@id+1, 'gobject activate'),
+(@id+2, 'gobject add'),
+(@id+3, 'gobject add temp'),
+(@id+4, 'gobject delete'),
+(@id+5, 'gobject info'),
+(@id+6, 'gobject move'),
+(@id+7, 'gobject near'),
+(@id+8, 'gobject set'),
+(@id+9, 'gobject set phase'),
+(@id+10, 'gobject set state'),
+(@id+11, 'gobject target'),
+(@id+12, 'gobject turn');
+
+-- Add permissions to "corresponding Commands Role"
+DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+12;
+INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES
+(3, @id+0),
+(3, @id+1),
+(3, @id+2),
+(3, @id+3),
+(3, @id+4),
+(3, @id+5),
+(3, @id+6),
+(3, @id+7),
+(3, @id+8),
+(3, @id+9),
+(3, @id+10),
+(3, @id+11),
+(3, @id+12);
diff --git a/sql/updates/world/2013_09_02_08_world_command.sql b/sql/updates/world/2013_09_02_08_world_command.sql
new file mode 100644
index 00000000000..d09a7030a5b
--- /dev/null
+++ b/sql/updates/world/2013_09_02_08_world_command.sql
@@ -0,0 +1,18 @@
+/* cs_gobject.cpp */
+
+SET @id = 371;
+
+-- Update command table with new RBAC permissions
+UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'gobject';
+UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'gobject activate';
+UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'gobject add';
+UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'gobject add temp';
+UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'gobject delete';
+UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'gobject info';
+UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'gobject move';
+UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'gobject near';
+UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'gobject set';
+UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'gobject set phase';
+UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'gobject set state';
+UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'gobject target';
+UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'gobject turn');