[evolvis-commits] r18399: [#2977] enable anonscm on public groups during approval

mirabilos at evolvis.org mirabilos at evolvis.org
Fri May 11 17:15:52 CEST 2012


Author: mirabilos
Date: 2012-05-11 17:15:51 +0200 (Fri, 11 May 2012)
New Revision: 18399

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/include/Group.class.php
Log:
[#2977] enable anonscm on public groups during approval

public is when the template group is public

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/Group.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/Group.class.php	2012-05-11 15:15:47 UTC (rev 18398)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/Group.class.php	2012-05-11 15:15:51 UTC (rev 18399)
@@ -2643,6 +2643,19 @@
 				}
 			}
 
+			if ($this->usesSCM()) {
+				/* the project to be approved uses SCM */
+
+				$ra = RoleAnonymous::getInstance();
+				/* see if the template project is public */
+				if ($ra->hasPermission('project_read',
+				    $template->getID())) {
+					/* yes ⇒ enable R/O anonymous SCM */
+					$ra->setSetting('scm',
+					    $this->getID(), 1);
+				}
+			}
+
 			$lm = new WidgetLayoutManager();
 			$lm->createDefaultLayoutForProject ($this->getID(), $template->getID()) ;
 



More information about the evolvis-commits mailing list