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

Jens Vagelpohl jens at dataflake.org
Fri Sep 3 12:12:38 EDT 2004


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

Modified Files:
      Tag: CMF-1_5-branch
	CMFCatalogAware.py 
Log Message:
- Fix for http://www.zope.org/Collectors/cmf/205: Local roles were not set
  correctly after pasting an object.


=== Products/CMFCore/CMFCatalogAware.py 1.21.2.1 => 1.21.2.2 ===
--- Products/CMFCore/CMFCatalogAware.py:1.21.2.1	Mon Aug 30 04:46:59 2004
+++ Products/CMFCore/CMFCatalogAware.py	Fri Sep  3 12:12:03 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