From c79af3f16f84d0d26bd69b5d06dd8754643ddc7f Mon Sep 17 00:00:00 2001
From: Nyeriah <sarah.trysan@live.com>
Date: Sat, 22 Nov 2014 00:30:24 -0200
Subject: Core/RBAC: Allow setting different default security level roles to
 different realms

---
 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 095669b2d12..844b76eac5b 100644
--- a/sql/base/auth_database.sql
+++ b/sql/base/auth_database.sql
@@ -334,7 +334,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';
@@ -346,7 +347,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 (3,192),(2,193),(1,194),(0,195);
+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

