[Fusionforge-commits] r14657 - in trunk: . src/plugins/moinmoin/lib

Roland Mas lolando at fusionforge.org
Fri Oct 14 18:08:24 CEST 2011


Author: lolando
Date: 2011-10-14 18:08:24 +0200 (Fri, 14 Oct 2011)
New Revision: 14657

Modified:
   trunk/
   trunk/src/plugins/moinmoin/lib/fusionforge.py
Log:
Use RBAC to determine if a project is public or not

Modified: trunk/src/plugins/moinmoin/lib/fusionforge.py
===================================================================
--- trunk/src/plugins/moinmoin/lib/fusionforge.py	2011-10-14 16:08:14 UTC (rev 14656)
+++ trunk/src/plugins/moinmoin/lib/fusionforge.py	2011-10-14 16:08:24 UTC (rev 14657)
@@ -122,9 +122,12 @@
         # Check whether this is a public project
         # anomymous users and registered users that are not part of the project
 
-        val = cur.execute("""SELECT is_public
-                             FROM groups
-                             WHERE unix_group_name='%s'""" % project_name)
+        val = cur.execute("""SELECT prs.perm_val
+                             FROM pfo_role_setting prs, groups g
+                             WHERE prs.role_id=1
+                               AND prs.section_name='project_read'
+                               AND prs.ref_id = g.group_id
+                               AND g.unix_group_name='%s'""" % project_name)
         val = cur.fetchone()
         is_public = val != None and val[0] != 0
         cur.close ()




More information about the Fusionforge-commits mailing list