From 99c4c4cee5c2455d881cb8f3459ddf82bbd7e96d Mon Sep 17 00:00:00 2001
From: Nyeriah <sarah.trysan@live.com>
Date: Wed, 10 Dec 2014 22:50:28 -0200
Subject: Core/RBAC: Allow setting different default security level roles to
 different realms

(cherry picked from commit c79af3f16f84d0d26bd69b5d06dd8754643ddc7f)
---
 sql/base/auth_database.sql | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'sql/base/auth_database.sql')

diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql
index 35abaa2611c..9da864cb9a2 100644
--- a/sql/base/auth_database.sql
+++ b/sql/base/auth_database.sql
@@ -455,7 +455,8 @@ DROP TABLE IF EXISTS `rbac_default_permissions`;
 CREATE TABLE `rbac_default_permissions` (
   `secId` int(10) unsigned NOT NULL COMMENT 'Security Level id',
   `permissionId` int(10) unsigned NOT NULL COMMENT 'permission id',
-  PRIMARY KEY (`secId`,`permissionId`),
+  `realmId` int(11) NOT NULL DEFAULT '-1' COMMENT 'Realm Id, -1 means all',
+  PRIMARY KEY (`secId`,`permissionId`, `realmId`),
   KEY `fk__rbac_default_permissions__rbac_permissions` (`permissionId`),
   CONSTRAINT `fk__rbac_default_permissions__rbac_permissions` FOREIGN KEY (`permissionId`) REFERENCES `rbac_permissions` (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Default permission to assign to different account security levels';
@@ -467,7 +468,7 @@ CREATE TABLE `rbac_default_permissions` (
 
 LOCK TABLES `rbac_default_permissions` WRITE;
 /*!40000 ALTER TABLE `rbac_default_permissions` DISABLE KEYS */;
-INSERT INTO `rbac_default_permissions` VALUES (0,195),(1,194),(2,193),(3,192);
+INSERT INTO `rbac_default_permissions` VALUES (3,192,-1),(2,193,-1),(1,194,-1),(0,195,-1);
 /*!40000 ALTER TABLE `rbac_default_permissions` ENABLE KEYS */;
 UNLOCK TABLES;
 
-- 
cgit v1.2.3

