[Zope-CVS] CVS: Packages3/workflow/stateful - instance.py:1.6
Jim Fulton
jim@zope.com
Sat, 8 Feb 2003 11:52:28 -0500
Update of /cvs-repository/Packages3/workflow/stateful
In directory cvs.zope.org:/tmp/cvs-serv29723
Modified Files:
instance.py
Log Message:
Fixed the permission test. If the permission is zope.Public, then we
shouldn't bother checking, at all.
=== Packages3/workflow/stateful/instance.py 1.5 => 1.6 ===
--- Packages3/workflow/stateful/instance.py:1.5 Fri Feb 7 16:50:52 2003
+++ Packages3/workflow/stateful/instance.py Sat Feb 8 11:52:27 2003
@@ -101,14 +101,12 @@
for name, trans in clean_pd.transitions.items():
if self.status == trans.sourceState:
# check permissions
- #if trans.permission is not None:
- #if trans.permission == 'zope.Public':
- # permission = CheckerPublic
- #else:
- # permission = checkPermission(self, trans.permission)
-
- #if not sm.checkPermission(permission, self):
- # continue
+ permission = trans.permission
+ if (permission is not None
+ and permission != 'zope.Public'
+ and not sm.checkPermission(permission, self)
+ ):
+ continue
# evaluate conditions