[Mpuls-commits] r5518 - base/trunk/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 2 12:26:04 CET 2011


Author: ludwig
Date: 2011-11-02 12:26:02 +0100 (Wed, 02 Nov 2011)
New Revision: 5518

Modified:
   base/trunk/mpulsweb/lib/security.py
Log:
Issue 2402: Remove the old names converting from method hasRole.
This converting is no longer in use and is cleaned up.


Modified: base/trunk/mpulsweb/lib/security.py
===================================================================
--- base/trunk/mpulsweb/lib/security.py	2011-11-02 09:20:30 UTC (rev 5517)
+++ base/trunk/mpulsweb/lib/security.py	2011-11-02 11:26:02 UTC (rev 5518)
@@ -403,20 +403,10 @@
     return decorator(validate)
 
 def hasRole(rolelist):
-    old_role_names = {
-        'cm_ka': 'cm',
-        'admin_ka': 'admin',
-        'pb_ka': 'pb',
-        }
     try:
         user = session['USER_AUTHORIZED']
-        conv_roles = []
-        for r in rolelist:
-            # Mapping of rolenames. The old rolenames are used all over the
-            # application. So change them here.
-            conv_roles.append(old_role_names.get(r, r))
         user_role = user.getPermissionRole()
-        return user_role in conv_roles
+        return user_role in rolelist
     except KeyError:
         return False
 



More information about the Mpuls-commits mailing list