[evolvis-commits] r6541: Merged backported delegate-role-settings-to-plugins branch

Roland Mas lolando at debian.org
Mon Apr 19 10:52:33 CEST 2010


Author: Roland Mas <lolando at debian.org>
Date: 2010-04-19 10:52:33 +0200 (Mon, 19 Apr 2010)
New Revision: 6541

Modified:
   trunk/gforge_base/evolvisforge/gforge/common/include/Group.class.php
   trunk/gforge_base/evolvisforge/gforge/common/include/Plugin.class.php
   trunk/gforge_base/evolvisforge/gforge/common/include/Role.class.php
   trunk/gforge_base/evolvisforge/gforge/common/include/User.class.php
   trunk/gforge_base/evolvisforge/gforge/common/include/rbac_texts.php
   trunk/gforge_base/evolvisforge/gforge/common/include/utils.php
   trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php
   trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/cronjobs/create-wikis.sh
   trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/www/LocalSettings.php
Log:
Merged backported delegate-role-settings-to-plugins branch

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/Group.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/Group.class.php	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/Group.class.php	2010-04-19 08:52:33 UTC (rev 6541)
@@ -2436,14 +2436,24 @@
 		return $rolesId;
 	}
 
-	function normalizeAllRoles () {
-		$roles = $this->getRolesId () ;
-		
+	function getRoles () {
+		$result = array () ;
+
 		foreach ($roles as $role_id) {
 			$r = new Role ($this, $role_id) ;
-			$r->normalizeData () ;
+			$result[] = new Role ($this, $role_id) ;
 		}
-	}
+
+		return $result ;
+	}		
+
+	function normalizeAllRoles () {
+		$roles = $this->getRoles () ;
+		
+		foreach ($roles as $r) {
+ 			$r->normalizeData () ;
+ 		}
+ 	}
 }
 
 /**

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/Plugin.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/Plugin.class.php	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/Plugin.class.php	2010-04-19 08:52:33 UTC (rev 6541)
@@ -76,8 +76,48 @@
 		return true ; 
 	}
 
+	function registerRoleValues(&$params, $values) {
+		$role =& $params['role'] ;
+	}
+		
 }
 
+class PluginSpecificRoleSetting {
+	var $role ;
+	var $name = '' ;
+	var $section = '' ;
+	var $values = array () ;
+	var $default_values = array () ;
+
+	function PluginSpecificRoleSetting (&$role, $name) {
+		$this->role =& $role ;
+		$this->name = $name ;
+	}
+
+	function SetAllowedValues ($values) {
+		$this->role->role_values = array_replace_recursive ($this->role->role_values,
+								    array ($this->name => $values)) ;
+	}
+
+	function SetDefaultValues ($defaults) {
+		foreach ($defaults as $rname => $v) {
+			$this->role->defaults[$rname][$this->name] = $v ;
+		}
+	}
+
+	function setValueDescriptions ($descs) {
+		global $rbac_permission_names ;
+		foreach ($descs as $k => $v) {
+			$rbac_permission_names[$this->name.$k] = $v ;
+		}
+	}
+
+	function setDescription ($desc) {
+		global $rbac_edit_section_names ;
+		$rbac_edit_section_names[$this->name] = $desc ;
+	}
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/Role.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/Role.class.php	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/Role.class.php	2010-04-19 08:52:33 UTC (rev 6541)
@@ -31,30 +31,95 @@
 	var $setting_array;
 	var $role_vals;
 	var $Group;
-	var $role_values=array(
-	'projectadmin'=>array('0','A'),
-	'frs'=>array('0','1'),
-	'scm'=>array('-1','0','1'),
-	'docman'=>array('0','1'),
-	'forumadmin'=>array('0','2'),
-	'forum'=>array('-1','0','1','2'),
-	'newforum'=>array('-1','0','1','2'),
-	'trackeradmin'=>array('0','2'),
-	'tracker'=>array('-1','0','1','2','3'),
-	'newtracker'=>array('-1','0','1','2','3'),
-	'pmadmin'=>array('0','2'),
-	'pm'=>array('-1','0','1','2','3'),
-	'newpm'=>array('-1','0','1','2','3'),
-	'webcal'=>array('0','1','2'));
+	var $role_values = array(
+		'projectadmin' => array ('0','A'),
+		'frs'	       => array ('0','1'),
+		'scm'	       => array ('-1','0','1'),
+		'docman'       => array ('0','1'),
+		'forumadmin'   => array ('0','2'),
+		'forum'	       => array ('-1','0','1','2'),
+		'newforum'     => array ('-1','0','1','2'),
+		'trackeradmin' => array ('0','2'),
+		'tracker'      => array ('-1','0','1','2','3'),
+		'newtracker'   => array ('-1','0','1','2','3'),
+		'pmadmin'      => array ('0','2'),
+		'pm'	       => array ('-1','0','1','2','3'),
+		'newpm'	       => array ('-1','0','1','2','3'),
+		'webcal'       => array ('0','1','2'));
+	
+	var $defaults = array(
+		'Admin'		  => array( 'projectadmin'=>'A',
+					    'frs'=>'1',
+					    'scm'=>'1',
+					    'docman'=>'1',
+					    'forumadmin'=>'2',
+					    'forum'=>'2',
+					    'newforum'=>'2',
+					    'trackeradmin'=>'2',
+					    'tracker'=>'2',
+					    'newtracker'=>'2',
+					    'pmadmin'=>'2',
+					    'pm'=>'2',
+					    'newpm'=>'2',
+					    'webcal'=>'1' ),
+		'Senior Developer'=> array( 'projectadmin'=>'0',
+					    'frs'=>'1',
+					    'scm'=>'1',
+					    'docman'=>'1',
+					    'forumadmin'=>'2',
+					    'forum'=>'2',
+					    'newforum'=>'2',
+					    'trackeradmin'=>'2',
+					    'tracker'=>'2',
+					    'newtracker'=>'2',
+					    'pmadmin'=>'2',
+					    'pm'=>'2',
+					    'newpm'=>'2',
+					    'webcal'=>'2' ),
+		'Junior Developer'=> array( 'projectadmin'=>'0',
+					    'frs'=>'0',
+					    'scm'=>'1',
+					    'docman'=>'0',
+					    'forumadmin'=>'0',
+					    'forum'=>'1',
+					    'newforum'=>'1',
+					    'trackeradmin'=>'0',
+					    'tracker'=>'1',
+					    'newtracker'=>'1',
+					    'pmadmin'=>'0',
+					    'pm'=>'1',
+					    'newpm'=>'1',
+					    'webcal'=>'2' ),
+		'Doc Writer'	  => array( 'projectadmin'=>'0',
+					    'frs'=>'0',
+					    'scm'=>'0',
+					    'docman'=>'1',
+					    'forumadmin'=>'0',
+					    'forum'=>'1',
+					    'newforum'=>'1',
+					    'trackeradmin'=>'0',
+					    'tracker'=>'0',
+					    'newtracker'=>'0',
+					    'pmadmin'=>'0',
+					    'pm'=>'0' ,
+					    'newpm'=>'0' ,
+					    'webcal'=>'2'),
+		'Support Tech'	  => array( 'projectadmin'=>'0',
+					    'frs'=>'0',
+					    'scm'=>'0',
+					    'docman'=>'1',
+					    'forumadmin'=>'0',
+					    'forum'=>'1',
+					    'newforum'=>'1',
+					    'trackeradmin'=>'0',
+					    'tracker'=>'2',
+					    'newtracker'=>'2',
+					    'pmadmin'=>'0',
+					    'pm'=>'0' ,
+					    'newpm'=>'0' ,
+					    'webcal'=>'2')
+		);
 
-	var $defaults=array(
-		'Admin'=>array( 'projectadmin'=>'A', 'frs'=>'1', 'scm'=>'1', 'docman'=>'1', 'forumadmin'=>'2', 'forum'=>'2', 'newforum'=>'2', 'trackeradmin'=>'2', 'tracker'=>'2', 'newtracker'=>'2', 'pmadmin'=>'2', 'pm'=>'2', 'newpm'=>'2', 'webcal'=>'1' ),
-		'Senior Developer'=>array( 'projectadmin'=>'0', 'frs'=>'1', 'scm'=>'1', 'docman'=>'1', 'forumadmin'=>'2', 'forum'=>'2', 'newforum'=>'2', 'trackeradmin'=>'2', 'tracker'=>'2', 'newtracker'=>'2', 'pmadmin'=>'2', 'pm'=>'2', 'newpm'=>'2', 'webcal'=>'2' ),
-		'Junior Developer'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'1', 'docman'=>'0', 'forumadmin'=>'0', 'forum'=>'1', 'newforum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'1', 'newtracker'=>'1', 'pmadmin'=>'0', 'pm'=>'1', 'newpm'=>'1', 'webcal'=>'2' ),
-		'Doc Writer'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'0', 'docman'=>'1', 'forumadmin'=>'0', 'forum'=>'1', 'newforum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'0', 'newtracker'=>'0', 'pmadmin'=>'0', 'pm'=>'0' , 'newpm'=>'0' , 'webcal'=>'2'),
-		'Support Tech'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'0', 'docman'=>'1', 'forumadmin'=>'0', 'forum'=>'1', 'newforum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'2', 'newtracker'=>'2', 'pmadmin'=>'0', 'pm'=>'0' , 'newpm'=>'0' , 'webcal'=>'2')
-	);
-
 	/**
 	 *  Role($group,$id) - CONSTRUCTOR.
 	 *
@@ -73,7 +138,16 @@
 		$hook_params['role'] =& $this;
 		plugin_hook ("role_get", $hook_params);
 
-
+		if (isset ($GLOBALS['default_roles'])) {
+			$this->defaults = array_merge_recursive ($this->defaults,
+								 $GLOBALS['default_roles']) ;
+			foreach ($this->defaults as $k => $v) {
+				if (!array_key_exists ($GLOBALS['default_roles'], $k)) {
+					unset ($this->defaults[$k]) ;
+				}
+			}
+		}
+		
 		if (!$role_id) {
 			//setting up an empty object
 			//probably going to call create()
@@ -244,24 +318,31 @@
 		return true;
 	}
 
-	function normalizeData () {
-		db_begin () ;
-		$this->fetchData ($this->getID()) ;
+	function normalizeDataForSection (&$new_sa, $section) {
+		if (array_key_exists ($section, $this->setting_array)) {
+			// Keep existing value if any
+			$new_sa[$section][0] = $this->setting_array[$section][0] ;
+		} elseif (array_key_exists ($this->data_array['role_name'], $this->defaults)
+			  && array_key_exists ($section, $this->defaults[$this->data_array['role_name']])) {
+			// Use default value if one exists
+			$new_sa[$section][0] = $this->defaults[$this->data_array['role_name']][$section] ;
+		} else {
+			$new_sa[$section][0] = 0 ;
+		}
+		return $new_sa ;
+	}
 
-		$new_sa = array () ;
-
-		// Add missing settings
-		// ...project-wide settings
-		$arr = array ('projectadmin', 'frs', 'scm', 'docman', 'forumadmin', 'trackeradmin', 'newtracker', 'pmadmin', 'newpm', 'webcal') ;
-		foreach ($arr as $section) {
-			if (array_key_exists ($section, $this->setting_array)) {
-				$new_sa[$section][0] = $this->setting_array[$section][0] ;
-			} elseif (array_key_exists ($this->data_array['role_name'], $this->defaults)
-						    && array_key_exists ($section, $this->defaults[$this->data_array['role_name']])) {
-					  $new_sa[$section][0] = $this->defaults[$this->data_array['role_name']][$section] ;
-			} else {
-				$new_sa[$section][0] = 0 ;
-			}
+ 	function normalizeData () {
+ 		db_begin () ;
+ 		$this->fetchData ($this->getID()) ;
+ 		
+ 		$new_sa = array () ;
+		
+ 		// Add missing settings
+ 		// ...project-wide settings
+ 		$arr = array ('projectadmin', 'frs', 'scm', 'docman', 'forumadmin', 'newforum', 'trackeradmin', 'newtracker', 'pmadmin', 'newpm', 'webcal') ;
+ 		foreach ($arr as $section) {
+			$this->normalizeDataForSection ($new_sa, $section) ;
 		}
 
 		// ...tracker-related settings
@@ -318,6 +399,12 @@
 			}
 		}
 
+		// ...plugin-specific settings
+		$hook_params = array ();
+		$hook_params['role'] =& $this;
+		$hook_params['new_sa'] =& $new_sa ; 
+		plugin_hook ("role_normalize", $hook_params);
+
 		// Delete extra settings
 		db_query_params ('DELETE FROM role_setting WHERE role_id=$1 AND section_name <> ALL ($2)',
 				 array ($this->getID(),
@@ -334,15 +421,14 @@
 				 array ($this->getID(),
 					'pm',
 					db_int_array_to_any_clause (array_keys ($new_sa['pm'])))) ;
-
 		db_commit () ;
 
 		// Save
 		$this->update ($this->data_array['role_name'], $new_sa) ;
 
-		return true;
+		return true ;
 	}
-
+		
 	/**
 	 *  &getRoleVals - get all the values and language text strings for this section.
 	 *

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/User.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/User.class.php	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/User.class.php	2010-04-19 08:52:33 UTC (rev 6541)
@@ -1433,7 +1433,7 @@
 		$res = db_query_params ('SELECT role_id FROM user_group WHERE user_id=$1 AND group_id=$2',
 					array ($this->getID(),
 					       $group->getID())) ;
-		if (!$res) {
+		if (!$res || db_numrows($res) < 1) {
 			$this->setError('User::getRole::DB - Could Not get role_id '.db_error());
 			return false;
 		}

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/rbac_texts.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/rbac_texts.php	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/rbac_texts.php	2010-04-19 08:52:33 UTC (rev 6541)
@@ -26,9 +26,12 @@
  * This file maps symbolic values to localised texts for the role permissions
  */
 
+require_once $gfcommon.'include/PluginManager.class.php';
+
 function setup_rbac_strings () {
 	global $rbac_permission_names, $rbac_edit_section_names ;
-	$rbac_permission_names = array (
+	$rbac_permission_names = array_replace_recursive ($rbac_permission_names, 
+							  array (
 		'frspackage0' => _('Private'),
 		'frspackage1' => _('Public'),
 		'frspackage' => _('File Release System'),
@@ -92,9 +95,10 @@
 		'webcal2' => _('See'),
 		'webcal1' => _('Modify'),
 		'webcal0' => _('No access')
-		);
+								  ));
 
-	$rbac_edit_section_names = array (
+	$rbac_edit_section_names = array_replace_recursive ($rbac_edit_section_names,
+							    array (
 		'forum' => _('Forum'),
 		'newforum' => _('Default for new forums'),
 		'forumpublic' => _('Forum'),
@@ -117,7 +121,9 @@
 		'scm' => _('SCM'),
 		'scmpublic' => _('SCM'),
 		'docman' => _('Documentation Manager'),
-		) ;
+								    )) ;
+
+	plugin_hook ("role_translate_strings") ;
   }
 
 setup_rbac_strings () ;

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/utils.php	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/utils.php	2010-04-19 08:52:33 UTC (rev 6541)
@@ -983,6 +983,29 @@
 	}
 }
 
+// array_replace_recursive only appeared in PHP 5.3.0
+if (!function_exists('array_replace_recursive')) {
+	function array_replace_recursive ($a1, $a2) {
+		$result = $a1 ;
+
+		if (!is_array ($a2)) {
+			return $a2 ;
+		}
+
+		foreach ($a2 as $k => $v) {
+			if (!is_array ($v) ||
+			    !isset ($result[$k]) || !is_array ($result[$k])) {
+				$result[$k] = $v ;
+			}
+			
+			$result[$k] = array_replace_recursive ($result[$k],
+							       $v) ;
+		}
+
+		return $result ;
+	}
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"

Modified: trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/common/MediaWikiPlugin.class.php	2010-04-19 08:52:33 UTC (rev 6541)
@@ -29,6 +29,9 @@
 		$this->hooks[] = "groupmenu" ;	// To put into the project tabs
 		$this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo
 		$this->hooks[] = "groupisactivecheckboxpost" ; //
+		$this->hooks[] = "role_get";
+		$this->hooks[] = "role_normalize";
+		$this->hooks[] = "role_translate_strings";
 	}
 
 	function CallHook ($hookname, $params) {
@@ -87,12 +90,32 @@
 			} else {
 				$group->setPluginUse ( $this->name, false );
 			}
-		}												    
-		elseif ($hookname == "blahblahblah") {
-			// ...
-		} 
+		} elseif ($hookname == "role_get") {
+			$role =& $params['role'] ;
+			
+			$edit = new PluginSpecificRoleSetting ($role,
+							       'plugin_mediawiki_edit') ;
+			$edit->SetAllowedValues (array ('0', '1', '2')) ;
+			$edit->SetDefaultValues (array ('Admin' => '2',
+							'Senior Developer' => '2',
+							'Junior Developer' => '1',
+							'Doc Writer' => '2',
+							'Support Tech' => '0')) ;
+		} elseif ($hookname == "role_normalize") {
+			$role =& $params['role'] ;
+			$new_sa =& $params['new_sa'] ;
+
+			$role->normalizeDataForSection ($new_sa, 'plugin_mediawiki_edit') ;
+		} elseif ($hookname == "role_translate_strings") {
+			$edit = new PluginSpecificRoleSetting ($role,
+							       'plugin_mediawiki_edit') ;
+			$edit->setDescription (_('Mediawiki write access')) ;
+			$edit->setValueDescriptions (array ('0' => _('No editing'),
+							    '1' => _('Edit existing pages only'), 
+							    '2' => _('Edit and create pages'))) ;
+		}
 	}
-}
+  }
 
 // Local Variables:
 // mode: php

Modified: trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/cronjobs/create-wikis.sh
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/cronjobs/create-wikis.sh	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/cronjobs/create-wikis.sh	2010-04-19 08:52:33 UTC (rev 6541)
@@ -31,11 +31,10 @@
 // These are per-project settings. The global settings can be
 // changed in /etc/gforge/local.d/70plugin_mediawiki instead.
 
-// Edit permissions for group members
-//\$wgGroupPermissions['Members']['edit']          = true;
-//\$wgGroupPermissions['Members']['createpage']    = true;
-//\$wgGroupPermissions['Members']['createtalk']    = true;
-//\$wgGroupPermissions['Members']['read']          = true;
+// Edit permissions for group members are managed with the FusionForge roles
+// Other permissions can still be set up such as:
+// \$wgGroupPermissions['Members']['import']          = true;
+// \$wgGroupPermissions['Members']['read']          = true;
 
 // Edit permissions for non-members
 //\$wgGroupPermissions['ForgeUsers']['edit']          = false;

Modified: trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/www/LocalSettings.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/www/LocalSettings.php	2010-04-16 14:32:44 UTC (rev 6540)
+++ trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/www/LocalSettings.php	2010-04-19 08:52:33 UTC (rev 6541)
@@ -109,6 +109,7 @@
                 $u = user_get_object ($s);
 		$g = group_get_object_by_name ($fusionforgeproject) ;
 		$perm =& $g->getPermission($u);
+		$r =& $u->getRole($g) ;
 
                 $mwname = ucfirst($u->getUnixName ()) ;
                 $mwu = User::newFromName ($mwname);
@@ -124,6 +125,25 @@
 
 		$user->loadGroups() ;
 		$current_groups = $user->getGroups() ;
+
+		# Role-based access control
+		if ($r->isError()) {
+			$rname = '' ;
+		} else {
+			$rname = "ForgeRole:".$r->getName () ;
+		}
+		$role_groups = preg_grep ("^ForgeRole:", $current_groups) ;
+		foreach ($role_groups as $cg) {
+			if ($cg != $rname) {
+                                $user->removeGroup ($cg) ;
+			}
+		}
+		if (!in_array ($rname, $current_groups)) {
+			$user->addGroup ($rname) ;
+		}
+
+		# Previous (group-based) access control
+		$current_groups = $user->getGroups() ;
                 if ($perm && is_object($perm) && $perm->isAdmin()) {
                         if (!in_array ('Administrators', $current_groups)) {
                                 $user->addGroup ('Administrators') ;
@@ -185,12 +205,31 @@
 
 $GLOBALS['wgHooks']['UserLoadFromSession'][]='FusionForgeMWAuth';
 
-$wgGroupPermissions['Members']['createaccount'] = true;
-$wgGroupPermissions['Members']['edit']          = ifsetor($sys_plugin_mediawiki_access_member_edit);
-$wgGroupPermissions['Members']['createpage']    = ifsetor($sys_plugin_mediawiki_access_member_createpage);
-$wgGroupPermissions['Members']['createtalk']    = ifsetor($sys_plugin_mediawiki_access_member_createtalk);
 $wgGroupPermissions['Members']['read']          = ifsetor($sys_plugin_mediawiki_access_member_read, true);
 
+$g = group_get_object_by_name ($fusionforgeproject) ;
+$roles = $g->getRoles () ;
+foreach ($roles as $role) {
+	$gr = "ForgeRole:".$role->getName () ;
+	switch ($role->getVal('plugin_mediawiki_edit', 0)) {
+	case 0:
+		$wgGroupPermissions[$gr]['edit']          = false;
+		$wgGroupPermissions[$gr]['createpage']    = false;
+		$wgGroupPermissions[$gr]['createtalk']    = false;
+		break ;
+	case 1:
+		$wgGroupPermissions[$gr]['edit']          = true;
+		$wgGroupPermissions[$gr]['createpage']    = false;
+		$wgGroupPermissions[$gr]['createtalk']    = false;
+		break ;
+	case 2:
+		$wgGroupPermissions[$gr]['edit']          = true;
+		$wgGroupPermissions[$gr]['createpage']    = true;
+		$wgGroupPermissions[$gr]['createtalk']    = true;
+		break ;
+	}
+}
+
 $wgGroupPermissions['ForgeUsers']['createaccount'] = false;
 $wgGroupPermissions['ForgeUsers']['edit']          = ifsetor($sys_plugin_mediawiki_access_user_edit);
 $wgGroupPermissions['ForgeUsers']['createpage']    = ifsetor($sys_plugin_mediawiki_access_user_createpage);




More information about the evolvis-commits mailing list