[Mpuls-commits] r3408 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Aug 13 20:03:11 CEST 2010


Author: bh
Date: 2010-08-13 20:03:08 +0200 (Fri, 13 Aug 2010)
New Revision: 3408

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/search.py
Log:
* mpulsweb/lib/search.py (CaseSearch.get_allowed_viewer_clause):
Clarify the logic a little, especially make it clearer what
happens when the current user is an admin


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-08-13 17:42:49 UTC (rev 3407)
+++ base/trunk/ChangeLog	2010-08-13 18:03:08 UTC (rev 3408)
@@ -1,5 +1,11 @@
 2010-08-13  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/search.py (CaseSearch.get_allowed_viewer_clause):
+	Clarify the logic a little, especially make it clearer what
+	happens when the current user is an admin
+
+2010-08-13  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/search.py (CaseSearch.get_where): Split into the
 	following methods:
 	(CaseSearch.get_allowed_viewer_clause)

Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py	2010-08-13 17:42:49 UTC (rev 3407)
+++ base/trunk/mpulsweb/lib/search.py	2010-08-13 18:03:08 UTC (rev 3408)
@@ -131,6 +131,9 @@
 
         Derived classes may override this method if necessary.
         """
+        if hasRole(['admin_ka', 'pb_ka']):
+            return "TRUE"
+
         which_user = 0
         allowed_viewer = "FALSE"
         if options.has_key('own'):
@@ -143,8 +146,6 @@
             allowed_viewer = "m.bearbeiter_id = %s" % options.get('own')
         if which_user == 3:
             allowed_viewer = "TRUE"
-        allowed_viewer = (hasRole(['admin_ka', 'pb_ka'])
-                          and "TRUE" or allowed_viewer)
         return allowed_viewer
 
     def get_editor_clause(self, options):



More information about the Mpuls-commits mailing list