[CMF-checkins] CVS: CMF/CMFSetup - workflow.py:1.12
Tres Seaver
tseaver at zope.com
Tue Jun 8 21:23:13 EDT 2004
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv1326
Modified Files:
workflow.py
Log Message:
- workflow.py:
o Add parsing for top-level permission nodes.
- xml/wtcWorkflowExport.xml:
o Modify guard roles / permissions / groups to avoid ambiguity.
=== CMF/CMFSetup/workflow.py 1.11 => 1.12 ===
--- CMF/CMFSetup/workflow.py:1.11 Tue Jun 8 21:09:14 2004
+++ CMF/CMFSetup/workflow.py Tue Jun 8 21:22:42 2004
@@ -229,7 +229,7 @@
transitions = _extractTransitionNodes( root )
variables = _extractVariableNodes( root )
worklists = _extractWorklistNodes( root )
- permissions = []
+ permissions = _extractPermissionNodes( root )
scripts = []
return ( workflow_id
@@ -808,6 +808,16 @@
return result
+def _extractPermissionNodes( root, encoding=None ):
+
+ result = []
+
+ for p_node in root.getElementsByTagName( 'permission' ):
+
+ result.append( _coalesceTextNodeChildren( p_node, encoding ) )
+
+ return result
+
def _extractActionNode( parent, encoding=None ):
nodes = parent.getElementsByTagName( 'action' )
@@ -833,7 +843,7 @@
node = nodes[ 0 ]
- expr_nodes = node.getElementsByTagName( 'expression' )
+ expr_nodes = node.getElementsByTagName( 'guard-expression' )
assert( len( expr_nodes ) <= 1 )
expr_text = expr_nodes and _coalesceTextNodeChildren( expr_nodes[ 0 ]
@@ -842,11 +852,11 @@
return { 'permissions' : [ _coalesceTextNodeChildren( x, encoding )
for x in node.getElementsByTagName(
- 'permission' ) ]
+ 'guard-permission' ) ]
, 'roles' : [ _coalesceTextNodeChildren( x, encoding )
- for x in node.getElementsByTagName( 'role' ) ]
+ for x in node.getElementsByTagName( 'guard-role' ) ]
, 'groups' : [ _coalesceTextNodeChildren( x, encoding )
- for x in node.getElementsByTagName( 'group' ) ]
+ for x in node.getElementsByTagName( 'guard-group' ) ]
, 'expression' : expr_text
}
More information about the CMF-checkins
mailing list