[Zope-CVS] SVN: GenericSetup/trunk/rolemap.py - made 'roles' optional (for update mode)

Yvo Schubbe y.2006_ at wcm-solutions.de
Sun Feb 12 12:27:58 EST 2006


Log message for revision 41604:
  - made 'roles' optional (for update mode)
  - made sure 'roles' are sorted (for smaller diffs)
  - removed redundant code (list was copied twice)

Changed:
  U   GenericSetup/trunk/rolemap.py

-=-
Modified: GenericSetup/trunk/rolemap.py
===================================================================
--- GenericSetup/trunk/rolemap.py	2006-02-12 15:32:11 UTC (rev 41603)
+++ GenericSetup/trunk/rolemap.py	2006-02-12 17:27:57 UTC (rev 41604)
@@ -81,7 +81,7 @@
         rc = RolemapConfigurator( site, encoding )
         rolemap_info = rc.parseXML( text )
 
-        immediate_roles = list( getattr( site, '__ac_roles__', [] ) )[:]
+        immediate_roles = list( getattr(site, '__ac_roles__', []) )
         already = {}
 
         for role in site.valid_roles():
@@ -186,7 +186,7 @@
             if roles or not acquire:
                 permissions.append( { 'name'    : name
                                     , 'acquire' : acquire
-                                    , 'roles'   : roles
+                                    , 'roles'   : sorted(roles)
                                     } )
 
         return permissions
@@ -199,7 +199,7 @@
 
         return {
           'rolemap':
-            { 'roles':       {CONVERTER: self._convertToUnique},
+            { 'roles':       {CONVERTER: self._convertToUnique, DEFAULT: ()},
               'permissions': {CONVERTER: self._convertToUnique} },
           'roles':
             { 'role':        {KEY: None} },



More information about the Zope-CVS mailing list