[CMF-checkins] CVS: CMF/CMFCore - TypesTool.py:1.54.6.1
Yvo Schubbe
schubbe@web.de
Tue, 10 Jun 2003 13:16:39 -0400
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv13595/CMFCore
Modified Files:
Tag: yuppie-collector165-branch
TypesTool.py
Log Message:
- made sure constructor ownership is explicit (Collector #165)
=== CMF/CMFCore/TypesTool.py 1.54 => 1.54.6.1 ===
--- CMF/CMFCore/TypesTool.py:1.54 Fri May 9 17:40:23 2003
+++ CMF/CMFCore/TypesTool.py Tue Jun 10 13:16:39 2003
@@ -16,14 +16,14 @@
"""
import sys
-from Globals import InitializeClass
from Globals import DTMLFile
-from AccessControl import getSecurityManager
+from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
+from AccessControl import getSecurityManager
from AccessControl import Unauthorized
from Acquisition import aq_base
+from Acquisition import aq_get
from zLOG import LOG, WARNING, ERROR
-
from OFS.Folder import Folder
import Products
@@ -31,8 +31,6 @@
from interfaces.portal_types import portal_types as ITypesTool
from ActionProviderBase import ActionProviderBase
-from ActionInformation import ActionInformation
-from Expression import Expression
from CMFCorePermissions import View
from CMFCorePermissions import ManagePortal
@@ -458,6 +456,10 @@
raise Unauthorized
constructor = self.restrictedTraverse( self.constructor_path )
+ # make sure ownership is explicit before switching the context
+ if not hasattr( aq_base(constructor), '_owner' ):
+ constructor._owner = aq_get(constructor, '_owner')
+
# Rewrap to get into container's context.
constructor = aq_base(constructor).__of__( container )