[CMF-checkins] SVN: CMF/branches/1.6/ - DCWorkflow.exportimport: Workflows managing no permissions at all

Jens Vagelpohl jens at dataflake.org
Fri Jan 27 18:49:11 EST 2006


Log message for revision 41472:
  - DCWorkflow.exportimport: Workflows managing no permissions at all
    could make the DCWorkflow workflow exporter fail.
    (http://www.zope.org/Collectors/CMF/397)
  

Changed:
  U   CMF/branches/1.6/CHANGES.txt
  U   CMF/branches/1.6/DCWorkflow/exportimport.py
  U   CMF/branches/1.6/DCWorkflow/tests/test_exportimport.py

-=-
Modified: CMF/branches/1.6/CHANGES.txt
===================================================================
--- CMF/branches/1.6/CHANGES.txt	2006-01-27 23:47:53 UTC (rev 41471)
+++ CMF/branches/1.6/CHANGES.txt	2006-01-27 23:49:10 UTC (rev 41472)
@@ -2,6 +2,10 @@
 
   Bug Fixes
 
+    - DCWorkflow.exportimport: Workflows managing no permissions at all 
+      could make the DCWorkflow workflow exporter fail.
+      (http://www.zope.org/Collectors/CMF/397)
+
     - Removed BBBTransaction class from CMFCore.utils
 
     - Fixed import of actions from extension profiles, now they don't

Modified: CMF/branches/1.6/DCWorkflow/exportimport.py
===================================================================
--- CMF/branches/1.6/DCWorkflow/exportimport.py	2006-01-27 23:47:53 UTC (rev 41471)
+++ CMF/branches/1.6/DCWorkflow/exportimport.py	2006-01-27 23:49:10 UTC (rev 41472)
@@ -371,16 +371,18 @@
           'acquired' -- whether roles are acquired for the permission
         """
         result = []
+        perm_roles = state.permission_roles
 
-        items = state.permission_roles.items()
-        items.sort()
+        if perm_roles:
+            items = state.permission_roles.items()
+            items.sort()
 
-        for k, v in items:
+            for k, v in items:
 
-            result.append( { 'name' : k
-                           , 'roles' : v
-                           , 'acquired' : not isinstance( v, tuple )
-                           } )
+                result.append( { 'name' : k
+                               , 'roles' : v
+                               , 'acquired' : not isinstance( v, tuple )
+                               } )
 
         return result
 

Modified: CMF/branches/1.6/DCWorkflow/tests/test_exportimport.py
===================================================================
--- CMF/branches/1.6/DCWorkflow/tests/test_exportimport.py	2006-01-27 23:47:53 UTC (rev 41471)
+++ CMF/branches/1.6/DCWorkflow/tests/test_exportimport.py	2006-01-27 23:49:10 UTC (rev 41472)
@@ -122,7 +122,7 @@
                                , transitions=v[ 2 ]
                                )
             if not v[ 3 ]:
-                state.permission_roles = {}
+                state.permission_roles = None
 
             for permission, roles in v[ 3 ].items():
                 state.setPermission( permission



More information about the CMF-checkins mailing list