[Fusionforge-commits] r8621 - trunk/gforge/www/frs/admin

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Tue Dec 22 21:02:47 CET 2009


Author: aljeux
Date: 2009-12-22 21:02:47 +0100 (Tue, 22 Dec 2009)
New Revision: 8621

Modified:
   trunk/gforge/www/frs/admin/qrs.php
Log:
FRS: Allow QRS for people with at least one write access to a package

Modified: trunk/gforge/www/frs/admin/qrs.php
===================================================================
--- trunk/gforge/www/frs/admin/qrs.php	2009-12-22 20:02:42 UTC (rev 8620)
+++ trunk/gforge/www/frs/admin/qrs.php	2009-12-22 20:02:47 UTC (rev 8621)
@@ -25,8 +25,23 @@
 if (!$g || $g->isError()) {
 	exit_error('Error',$g->getErrorMessage());
 }
+
+// check the permissions and see if this user is a release manager.
+// If so, he can create a release
 $perm =& $g->getPermission(session_get_user());
-if (!$perm->isReleaseTechnician()) {
+$can_post = $perm->isReleaseTechnician();
+$packages = get_frs_packages($g);
+
+if (!$can_post) {
+	// If user has write access to at least one package, then it's ok.
+	foreach ( $packages as $f ) {
+		if ($f->userCanPost()) {
+			$can_post = true;
+		}
+	}
+}
+
+if (!$can_post) {
 	exit_permission_denied();
 }
 
@@ -226,7 +241,7 @@
 		<span class="important">
 		<?php echo _('NOTE: In some browsers you must select the file in the file-upload dialog and click "OK".  Double-clicking doesn\'t register the file.')?>)</span><br />
 		<?php echo _('Upload a new file') ?>: <input type="file" name="userfile"  size="30" />
-		<?php if ($sys_use_ftpuploads) { 
+		<?php if ($sys_use_ftpuploads) {
 
 			echo '<p>';
 			printf(_('Alternatively, you can use FTP to upload a new file at %1$s'), $sys_ftp_upload_host).'<br />';




More information about the Fusionforge-commits mailing list