aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2013-09-02 11:53:22 +0200
committerSpp <spp@jorge.gr>2013-09-02 11:53:22 +0200
commit08ef6bd9f8c76c0606818cb66c4754a28f185e25 (patch)
tree6c6e99a53f20c9cc1cb0fd763db875a040c4469a /sql
parent11233dbd736f8166d8e8565915ab4712d11d7eb3 (diff)
Core/RBAC: Move honor commands to RBAC (using individual permissions)
Diffstat (limited to 'sql')
-rw-r--r--sql/updates/auth/2013_09_02_08_auth_misc.sql22
-rw-r--r--sql/updates/auth/2013_09_02_09_auth_misc.sql19
-rw-r--r--sql/updates/world/2013_09_02_10_world_command.sql9
3 files changed, 36 insertions, 14 deletions
diff --git a/sql/updates/auth/2013_09_02_08_auth_misc.sql b/sql/updates/auth/2013_09_02_08_auth_misc.sql
index b6bf442aeb5..6efc9765ab6 100644
--- a/sql/updates/auth/2013_09_02_08_auth_misc.sql
+++ b/sql/updates/auth/2013_09_02_08_auth_misc.sql
@@ -1,25 +1,19 @@
-/* cs_guild.cpp */
+/* cs_honor.cpp */
SET @id = 401;
-- Add new permissions
-DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+6;
+DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+3;
INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
-(@id+0, 'guild'),
-(@id+1, 'guild create'),
-(@id+2, 'guild delete'),
-(@id+3, 'guild invite'),
-(@id+4, 'guild uninvite'),
-(@id+5, 'guild rank'),
-(@id+6, 'guild rename');
+(@id+0, 'honor'),
+(@id+1, 'honor add'),
+(@id+2, 'honor add kill'),
+(@id+3, 'honor update');
-- Add permissions to "corresponding Commands Role"
-DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+6;
+DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+3;
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+3);
diff --git a/sql/updates/auth/2013_09_02_09_auth_misc.sql b/sql/updates/auth/2013_09_02_09_auth_misc.sql
new file mode 100644
index 00000000000..3b16d9181d5
--- /dev/null
+++ b/sql/updates/auth/2013_09_02_09_auth_misc.sql
@@ -0,0 +1,19 @@
+/* cs_honor.cpp */
+
+SET @id = 408;
+
+-- Add new permissions
+DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+3;
+INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
+(@id+0, 'honor'),
+(@id+1, 'honor add'),
+(@id+2, 'honor add kill'),
+(@id+3, 'honor update');
+
+-- Add permissions to "corresponding Commands Role"
+DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+3;
+INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES
+(2, @id+0),
+(2, @id+1),
+(2, @id+2),
+(2, @id+3);
diff --git a/sql/updates/world/2013_09_02_10_world_command.sql b/sql/updates/world/2013_09_02_10_world_command.sql
new file mode 100644
index 00000000000..f038adf1b30
--- /dev/null
+++ b/sql/updates/world/2013_09_02_10_world_command.sql
@@ -0,0 +1,9 @@
+/* cs_honor.cpp */
+
+SET @id = 408;
+
+-- Update command table with new RBAC permissions
+UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'honor';
+UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'honor add';
+UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'honor add kill';
+UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'honor update';