[Fusionforge-commits] r9799 - trunk/gforge/common/include

Roland Mas lolando at libremir.placard.fr.eu.org
Fri May 21 09:47:27 CEST 2010


Author: lolando
Date: 2010-05-21 09:47:26 +0200 (Fri, 21 May 2010)
New Revision: 9799

Modified:
   trunk/gforge/common/include/GroupJoinRequest.class.php
   trunk/gforge/common/include/Navigation.class.php
   trunk/gforge/common/include/RoleObserver.class.php
Log:
RBAC migration in progress

Modified: trunk/gforge/common/include/GroupJoinRequest.class.php
===================================================================
--- trunk/gforge/common/include/GroupJoinRequest.class.php	2010-05-21 07:47:16 UTC (rev 9798)
+++ trunk/gforge/common/include/GroupJoinRequest.class.php	2010-05-21 07:47:26 UTC (rev 9799)
@@ -281,16 +281,9 @@
 			$this->setError('Must be sure before deleting');
 			return false;
 		}
-		$perm =& $this->Group->getPermission ();
-		if (!$perm || !is_object($perm)) {
+		if (! forge_check_perm ('project_admin', $this->Group->getID())) {
 			$this->setPermissionDeniedError();
 			return false;
-		} elseif ($perm->isError()) {
-			$this->setPermissionDeniedError();
-			return false;
-		} elseif (!$perm->isAdmin()) {
-			$this->setPermissionDeniedError();
-			return false;
 		} else {
 			$res = db_query_params ('DELETE FROM group_join_request WHERE group_id=$1 AND user_id=$2',
 						array ($this->Group->getID(),

Modified: trunk/gforge/common/include/Navigation.class.php
===================================================================
--- trunk/gforge/common/include/Navigation.class.php	2010-05-21 07:47:16 UTC (rev 9798)
+++ trunk/gforge/common/include/Navigation.class.php	2010-05-21 07:47:26 UTC (rev 9799)
@@ -363,8 +363,6 @@
                                 return;
                         }
                         
-                        $perm =& $group->getPermission ();
-                        
                         $selected = 0;
                         
                         $menu =& $this->project_menu_data[$group_id];

Modified: trunk/gforge/common/include/RoleObserver.class.php
===================================================================
--- trunk/gforge/common/include/RoleObserver.class.php	2010-05-21 07:47:16 UTC (rev 9798)
+++ trunk/gforge/common/include/RoleObserver.class.php	2010-05-21 07:47:26 UTC (rev 9799)
@@ -182,8 +182,7 @@
      *  @return boolean True on success or false on failure.
      */
 	function update($data) {
-		$perm =& $this->Group->getPermission ();
-		if (!$perm || !is_object($perm) || $perm->isError() || !$perm->isAdmin()) {
+		if (!forge_check_perm ('project_admin', $this->Group->getID())) {
 			$this->setPermissionDeniedError();
 			return false;
 		}




More information about the Fusionforge-commits mailing list