Commit 910efb13 authored by Shane Hathaway's avatar Shane Hathaway

Continuation of fix for bug #558. restrictedTraverse() incorrectly denied

access in certain situations when using a __bobo_traverse__ hook.
parent f8c22c39
...@@ -17,7 +17,7 @@ Page Template-specific implementation of TALES, with handlers ...@@ -17,7 +17,7 @@ Page Template-specific implementation of TALES, with handlers
for Python expressions, string literals, and paths. for Python expressions, string literals, and paths.
""" """
__version__='$Revision: 1.36 $'[11:-2] __version__='$Revision: 1.37 $'[11:-2]
import re, sys import re, sys
from TALES import Engine, CompilerError, _valid_name, NAME_RE, \ from TALES import Engine, CompilerError, _valid_name, NAME_RE, \
...@@ -315,7 +315,11 @@ def restrictedTraverse(self, path, securityManager, ...@@ -315,7 +315,11 @@ def restrictedTraverse(self, path, securityManager,
o=t(REQUEST, name) o=t(REQUEST, name)
container = None 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 container = o.im_self
elif (has(get(object, 'aq_base', object), name) elif (has(get(object, 'aq_base', object), name)
and get(object, name) == o): and get(object, name) == o):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment