[CMF-checkins] CVS: CMF/CMFCore - ActionsTool.py:1.27.10.1

Florent Guillaume fg@nuxeo.com
Fri, 19 Jul 2002 12:58:05 -0400


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv28380/CMFCore

Modified Files:
      Tag: CMF-1_3-branch
	ActionsTool.py 
Log Message:
Merged change from HEAD:

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.27.10.1 ===
                 # 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