1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Index: Five/viewlet/manager.py
===================================================================
--- Five/viewlet/manager.py	(revision 78510)
+++ Five/viewlet/manager.py	(working copy)
@@ -8,6 +8,7 @@
 from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile

 aq_base = Acquisition.aq_base
+aq_inner = Acquisition.aq_inner

 class ViewletManagerBase(origManagerBase, Acquisition.Explicit):
     """A base class for Viewlet managers to work in Zope2"""
@@ -25,7 +26,7 @@
                 'No provider with name `%s` found.' %name)

         # Wrap the viewlet for security lookups
-        viewlet = viewlet.__of__(viewlet.context)
+        viewlet = viewlet.__of__(aq_inner(viewlet.context))

         # If the viewlet cannot be accessed, then raise an
         # unauthorized error
@@ -48,7 +49,7 @@
         # the object has a real context from which to determine owner
         # security.
         for name, viewlet in viewlets:
-            viewlet = viewlet.__of__(viewlet.context)
+            viewlet = viewlet.__of__(aq_inner(viewlet.context))
             if guarded_hasattr(viewlet, 'render'):
                 results.append((name, viewlet))
         return results