[Fusionforge-commits] r9801 - trunk/gforge/common/frs

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


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

Modified:
   trunk/gforge/common/frs/FRSFile.class.php
   trunk/gforge/common/frs/FRSPackage.class.php
   trunk/gforge/common/frs/FRSRelease.class.php
Log:
RBAC migration in progress: FRS classes

Modified: trunk/gforge/common/frs/FRSFile.class.php
===================================================================
--- trunk/gforge/common/frs/FRSFile.class.php	2010-05-21 07:47:38 UTC (rev 9800)
+++ trunk/gforge/common/frs/FRSFile.class.php	2010-05-21 07:47:48 UTC (rev 9801)
@@ -108,9 +108,7 @@
 			return false;
 		}
 
-		$perm =& $this->FRSRelease->FRSPackage->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->FRSRelease->FRSPackage->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}
@@ -320,9 +318,7 @@
 	 *  @return	boolean	success.
 	 */
 	function delete() {
-		$perm =& $this->FRSRelease->FRSPackage->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->FRSRelease->FRSPackage->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}
@@ -358,9 +354,7 @@
 	 *	@return	boolean success.
 	 */
 	function update($type_id,$processor_id,$release_time,$release_id=false) {
-		$perm =& $this->FRSRelease->FRSPackage->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->FRSRelease->FRSPackage->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}

Modified: trunk/gforge/common/frs/FRSPackage.class.php
===================================================================
--- trunk/gforge/common/frs/FRSPackage.class.php	2010-05-21 07:47:38 UTC (rev 9800)
+++ trunk/gforge/common/frs/FRSPackage.class.php	2010-05-21 07:47:48 UTC (rev 9801)
@@ -139,9 +139,7 @@
 		if (!util_is_valid_filename($name)) {
 			$this->setError(_('FRSPackage::Update: Package Name can only be alphanumeric or "-" "_" "+" "." "~"'));
 		}
-		$perm =& $this->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}
@@ -370,9 +368,7 @@
 			return false;
 		}
 
-		$perm =& $this->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}		
@@ -453,9 +449,7 @@
 			$this->setMissingParamsError();
 			return false;
 		}
-		$perm =& $this->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}

Modified: trunk/gforge/common/frs/FRSRelease.class.php
===================================================================
--- trunk/gforge/common/frs/FRSRelease.class.php	2010-05-21 07:47:38 UTC (rev 9800)
+++ trunk/gforge/common/frs/FRSRelease.class.php	2010-05-21 07:47:48 UTC (rev 9801)
@@ -129,9 +129,7 @@
 			$preformatted = 0;
 		}
 
-		$perm =& $this->FRSPackage->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->FRSPackage->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}
@@ -360,9 +358,7 @@
 			$this->setMissingParamsError();
 			return false;
 		}
-		$perm =& $this->FRSPackage->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->FRSPackage->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}
@@ -408,9 +404,7 @@
 			return false;
 		}
 		
-		$perm =& $this->FRSPackage->Group->getPermission ();
-
-		if (!$perm || !is_object($perm) || !$perm->isReleaseTechnician()) {
+		if (!forge_check_perm ('frs', $this->FRSPackage->Group->getID(), 'write')) {
 			$this->setPermissionDeniedError();
 			return false;
 		}




More information about the Fusionforge-commits mailing list