[CMF-checkins] CVS: CMF/DCWorkflow - CHANGES.txt:1.7.18.1 Default.py:1.8.18.1 Expression.py:1.8.18.1
Shane Hathaway
shane@cvs.zope.org
Wed, 20 Feb 2002 15:14:58 -0500
Update of /cvs-repository/CMF/DCWorkflow
In directory cvs.zope.org:/tmp/cvs-serv27999/DCWorkflow
Modified Files:
Tag: cmf-pre-1_3-branch
CHANGES.txt Default.py Expression.py
Log Message:
Merged changes from head, with a small change: the types tool does not need
to be extended in such a complex way. I took out the type_type registry and
the __bobo_traverse__ hook and replaced it with the original code with only
minor mods that give you the same extensibility without all the hacking.
(If anyone actually wants to use the extensibility, which I suspect no one
is actually interested in doing, I will happily provide instructions and
will create a corrected unit test.)
=== CMF/DCWorkflow/CHANGES.txt 1.7 => 1.7.18.1 ===
- Fixed getInfoFor() using patch from Sebastien.Bigaret@inqual.com. Thanks!
-- executeTransition(): Preserve (by copying) any existing, unchanged
-state vars, rather than setting them to default value or just omitting
-them, if there's no default.
+- executeTransition(): Optionally preserve (by copying) unchanged
+status variables.
+
+- Updated to ZPL 2.0.
+
+- Added scripts that get executed after a transition.
Version 0.4.1
=== CMF/DCWorkflow/Default.py 1.8 => 1.8.18.1 ===
title='Waiting for reviewer',
transitions=('hide', 'publish', 'reject', 'retract',))
- sdef.setPermission(p_access, 1, (r_anon, r_manager, r_reviewer))
- sdef.setPermission(p_view, 1, (r_anon, r_manager, r_reviewer))
+ sdef.setPermission(p_access, 1, (r_manager, r_owner, r_reviewer))
+ sdef.setPermission(p_view, 1, (r_manager, r_owner, r_reviewer))
sdef.setPermission(p_modify, 0, (r_manager, r_reviewer))
sdef = wf.states['published']
@@ -80,7 +80,7 @@
transitions=('reject', 'retract',))
sdef.setPermission(p_access, 1, (r_anon, r_manager))
sdef.setPermission(p_view, 1, (r_anon, r_manager))
- sdef.setPermission(p_modify, 0, (r_manager))
+ sdef.setPermission(p_modify, 0, (r_manager,))
sdef = wf.states['visible']
sdef.setProperties(
@@ -226,8 +226,8 @@
sdef.setProperties(
title='Waiting for reviewer',
transitions=('publish', 'reject', 'retract',))
- sdef.setPermission(p_access, 1, (r_anon, r_manager, r_reviewer))
- sdef.setPermission(p_view, 1, (r_anon, r_manager, r_reviewer))
+ sdef.setPermission(p_access, 1, (r_manager, r_owner, r_reviewer))
+ sdef.setPermission(p_view, 1, (r_manager, r_owner, r_reviewer))
sdef.setPermission(p_modify, 0, (r_manager, r_reviewer))
sdef = wf.states['published']
=== CMF/DCWorkflow/Expression.py 1.8 => 1.8.18.1 ===
from Products.CMFCore.WorkflowCore import ObjectDeleted, ObjectMoved
+from Products.CMFCore.Expression import Expression
from Products.PageTemplates.Expressions import getEngine
from Products.PageTemplates.TALES import SafeMapping
-from Products.PageTemplates.PageTemplate import ModuleImporter
-
-
-class Expression (Persistent):
- text = ''
- _v_compiled = None
-
- security = ClassSecurityInfo()
-
- def __init__(self, text):
- self.text = text
- self._v_compiled = getEngine().compile(text)
-
- def __call__(self, econtext):
- compiled = self._v_compiled
- if compiled is None:
- compiled = self._v_compiled = getEngine().compile(self.text)
- # ?? Maybe expressions should manipulate the security
- # context stack.
- res = compiled(econtext)
- if isinstance(res, Exception):
- raise res
- #print 'returning %s from %s' % (`res`, self.text)
- return res
-
-Globals.InitializeClass(Expression)
-
+from Products.PageTemplates.Expressions import SecureModuleImporter
class StateChangeInfo:
'''
@@ -130,7 +105,7 @@
'nothing': None,
'root': wf.getPhysicalRoot(),
'request': getattr( ob, 'REQUEST', None ),
- 'modules': ModuleImporter,
+ 'modules': SecureModuleImporter,
'user': getSecurityManager().getUser(),
'state_change': sci,
'transition': sci.transition,