[Fusionforge-commits] r10536 - in trunk/src/plugins/mediawiki: common www

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Sep 17 18:02:41 CEST 2010


Author: lolando
Date: 2010-09-17 18:02:39 +0200 (Fri, 17 Sep 2010)
New Revision: 10536

Modified:
   trunk/src/plugins/mediawiki/common/MediaWikiPlugin.class.php
   trunk/src/plugins/mediawiki/www/LocalSettings.php
Log:
Also handle Mediawiki read access with RBAC

Modified: trunk/src/plugins/mediawiki/common/MediaWikiPlugin.class.php
===================================================================
--- trunk/src/plugins/mediawiki/common/MediaWikiPlugin.class.php	2010-09-17 15:49:56 UTC (rev 10535)
+++ trunk/src/plugins/mediawiki/common/MediaWikiPlugin.class.php	2010-09-17 16:02:39 UTC (rev 10536)
@@ -124,6 +124,14 @@
 		} elseif ($hookname == "role_get") {
 			$role =& $params['role'] ;
 
+			// Read access
+			$right->SetAllowedValues (array ('0', '1')) ;
+			$right->SetDefaultValues (array ('Admin' => '1',
+							 'Senior Developer' => '1',
+							 'Junior Developer' => '1',
+							 'Doc Writer' => '1',
+							 'Support Tech' => '1')) ;
+			
 			// Edit privileges
 			$right = new PluginSpecificRoleSetting ($role,
 								'plugin_mediawiki_edit') ;
@@ -170,6 +178,10 @@
 		} elseif ($hookname == "role_translate_strings") {
 			$right = new PluginSpecificRoleSetting ($role,
 							       'plugin_mediawiki_edit') ;
+			$right->setDescription (_('Mediawiki read access')) ;
+			$right->setValueDescriptions (array ('0' => _('No reading'),
+							     '1' => _('Read access'))) ;
+
 			$right->setDescription (_('Mediawiki write access')) ;
 			$right->setValueDescriptions (array ('0' => _('No editing'),
 							     '1' => _('Edit existing pages only'), 

Modified: trunk/src/plugins/mediawiki/www/LocalSettings.php
===================================================================
--- trunk/src/plugins/mediawiki/www/LocalSettings.php	2010-09-17 15:49:56 UTC (rev 10535)
+++ trunk/src/plugins/mediawiki/www/LocalSettings.php	2010-09-17 16:02:39 UTC (rev 10536)
@@ -200,6 +200,16 @@
 		foreach ($rs as $r) {
 			$gr = FusionForgeRoleToMediawikiGroupName ($r, $g) ;
 
+			// Read access
+			switch ($r->getVal('plugin_mediawiki_read', $g->getID())) {
+			case 0:
+				$wgGroupPermissions[$gr]['read'] = false;
+				break ;
+			case 1:
+				$wgGroupPermissions[$gr]['read'] = true;
+				break ;
+			}
+
 			// Day-to-day edit privileges
 			switch ($r->getVal('plugin_mediawiki_edit', $g->getID())) {
 			case 0:




More information about the Fusionforge-commits mailing list