[ZPT] CVS: Zope/lib/python/Products/PageTemplates - Expressions.py:1.37

Shane Hathaway shane@cvs.zope.org
Thu, 12 Sep 2002 17:53:46 -0400


Update of /cvs-repository/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv19159

Modified Files:
	Expressions.py 
Log Message:
Continuation of fix for bug #558.  restrictedTraverse() incorrectly denied
access in certain situations when using a __bobo_traverse__ hook.


=== Zope/lib/python/Products/PageTemplates/Expressions.py 1.36 => 1.37 ===
--- Zope/lib/python/Products/PageTemplates/Expressions.py:1.36	Wed Aug 14 18:17:24 2002
+++ Zope/lib/python/Products/PageTemplates/Expressions.py	Thu Sep 12 17:53:46 2002
@@ -315,7 +315,11 @@
             o=t(REQUEST, name)
 
             container = None
-            if has(o, 'im_self'):
+            if aq_base(o) is not o:
+                # The object is wrapped, so the acquisition
+                # context determines the container.
+                container = aq_parent(aq_inner(o))
+            elif has(o, 'im_self'):
                 container = o.im_self
             elif (has(get(object, 'aq_base', object), name)
                 and get(object, name) == o):