[CMF-checkins] CVS: CMF/CMFCore - ActionsTool.py:1.28
Florent Guillaume
fg@nuxeo.com
Fri, 19 Jul 2002 12:56:00 -0400
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv27386/CMFCore
Modified Files:
ActionsTool.py
Log Message:
Improved the ActionsTool so that permission checking for actions is done
in the context of the object for all categories that start with 'object'
or 'workflow', in the context of the folder for those that start with
'folder', and in the context of the portal otherwise.
This is useful for admin-defined additional categories.
=== CMF/CMFCore/ActionsTool.py 1.27 => 1.28 ===
# This action requires no extra permissions.
verified = 1
else:
- if category in ('object', 'workflow') and object is not None:
+ if (object is not None and
+ (category.startswith('object') or
+ category.startswith('workflow'))):
context = object
- elif category == 'folder' and folder is not None:
+ elif (folder is not None and
+ category.startswith('folder')):
context = folder
else:
context = portal