0013342: allow to configure default user/admin role names
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 17 Jul 2017 16:54:35 +0000 (18:54 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 17 Jul 2017 17:50:13 +0000 (19:50 +0200)
https://forge.tine20.org/view.php?id=13342

Change-Id: I4cd6585505ab0747b312b80411631d06d31624a8
Reviewed-on: http://gerrit.tine20.com/customers/5220
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Setup/Initialize.php
tine20/Tinebase/Config.php

index 1ede325..1c2a0a2 100644 (file)
@@ -128,10 +128,12 @@ class Setup_Initialize
         if (in_array(Tinebase_Acl_Rights::USE_PERSONAL_TAGS, $allRights)) {
             $userRights[] = Tinebase_Acl_Rights::USE_PERSONAL_TAGS;
         }
-        
+
+        $userRoleName = Tinebase_Config::getInstance()->get(Tinebase_Config::DEFAULT_USER_ROLE_NAME);
+        $adminRoleName = Tinebase_Config::getInstance()->get(Tinebase_Config::DEFAULT_ADMIN_ROLE_NAME);
         $roleRights = array(
-            'user role'     => $userRights,
-            'admin role'    => $allRights
+            $userRoleName     => $userRights,
+            $adminRoleName    => $allRights
         );
         
         foreach ($roleRights as $roleName => $rights) {
index 57ec9ad..da10211 100644 (file)
@@ -70,6 +70,16 @@ class Tinebase_Config extends Tinebase_Config_Abstract
     const DEFAULT_LOCALE = 'defaultLocale';
 
     /**
+     * default user role
+     */
+    const DEFAULT_USER_ROLE_NAME = 'defaultUserRoleName';
+
+    /**
+     * default user role
+     */
+    const DEFAULT_ADMIN_ROLE_NAME = 'defaulAdminRoleName';
+
+    /**
      * INTERNET_PROXY
      *
      * @var string
@@ -1021,6 +1031,26 @@ class Tinebase_Config extends Tinebase_Config_Abstract
 
             ),
         ),
+        self::DEFAULT_ADMIN_ROLE_NAME => array(
+            //_('Default Admin Role Name')
+            'label'                 => 'Default Admin Role Name',
+            'description'           => 'Default Admin Role Name',
+            'type'                  => 'string',
+            'clientRegistryInclude' => false,
+            'setByAdminModule'      => false,
+            'setBySetupModule'      => true,
+            'default'               => 'admin role'
+        ),
+        self::DEFAULT_USER_ROLE_NAME => array(
+            //_('Default User Role Name')
+            'label'                 => 'Default User Role Name',
+            'description'           => 'Default User Role Name',
+            'type'                  => 'string',
+            'clientRegistryInclude' => false,
+            'setByAdminModule'      => false,
+            'setBySetupModule'      => true,
+            'default'               => 'user role'
+        ),
         self::CRONUSERID => array(
                                    //_('Cronuser ID')
             'label'                 => 'Cronuser ID',