[Fusionforge-commits] r10593 - trunk/src/common/include

Roland Mas lolando at libremir.placard.fr.eu.org
Tue Sep 21 15:51:29 CEST 2010


Author: lolando
Date: 2010-09-21 15:51:29 +0200 (Tue, 21 Sep 2010)
New Revision: 10593

Modified:
   trunk/src/common/include/RBAC.php
Log:
Added method to get global settings from a role

Modified: trunk/src/common/include/RBAC.php
===================================================================
--- trunk/src/common/include/RBAC.php	2010-09-21 13:45:34 UTC (rev 10592)
+++ trunk/src/common/include/RBAC.php	2010-09-21 13:51:29 UTC (rev 10593)
@@ -531,6 +531,25 @@
 		return $result ;
 	}
 
+	function getGlobalSettings () {
+		$result = array () ;
+
+		$sections = array ('forge_admin', 'forge_stats', 'approve_projects', 'approve_news') ;
+		foreach ($sections as $section) {
+			$result[$section][-1] = $this->getVal ($section, -1) ;
+		}
+		// Add settings not yet listed so far (probably plugins)
+		foreach (array_keys ($this->perms_array) as $section) {
+			if (!in_array ($section, $sections)) {
+				if (in_array ($section, $this->global_settings)) {
+					$result[$section][-1] = $this->getVal ($section, -1) ;
+				}
+			}
+		}
+
+		return $result ;
+	}
+
         function getSetting($section, $reference) {
                 if (isset ($this->perms_array[$section][$reference])) {
 			$value = $this->perms_array[$section][$reference] ;




More information about the Fusionforge-commits mailing list