[CMF-checkins] CVS: Products/CMFCore - CMFCatalogAware.py:1.23

Jens Vagelpohl jens at dataflake.org
Fri Sep 3 11:59:23 EDT 2004


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv32065/CMFCore

Modified Files:
	CMFCatalogAware.py 
Log Message:
- Fix for http://www.zope.org/Collectors/cmf/205: Local roles were not
  updated after pasting a content item



=== Products/CMFCore/CMFCatalogAware.py 1.22 => 1.23 ===
--- Products/CMFCore/CMFCatalogAware.py:1.22	Mon Aug 30 04:47:26 2004
+++ Products/CMFCore/CMFCatalogAware.py	Fri Sep  3 11:58:48 2004
@@ -25,6 +25,7 @@
 from permissions import ManagePortal
 from permissions import ModifyPortalContent
 from utils import _dtmldir
+from utils import _getAuthenticatedUser
 from utils import getToolByName
 
 from interfaces.IOpaqueItems import ICallableOpaqueItem
@@ -174,6 +175,14 @@
         """
         self.notifyWorkflowCreated()
         self.__recurse('manage_afterClone', item)
+
+        # Make sure owner local role is set after pasting
+        # The standard Zope mechanisms take care of executable ownership
+        current_user = _getAuthenticatedUser(self)
+        if current_user is not None:
+            local_role_holders = [x[0] for x in self.get_local_roles()]
+            self.manage_delLocalRoles(local_role_holders)
+            self.manage_setLocalRoles(current_user.getId(), ['Owner'])
 
     def manage_beforeDelete(self, item, container):
         """



More information about the CMF-checkins mailing list