Commit d136d9c4 authored by Chris McDonough's avatar Chris McDonough

Made container and accessed default to aq_parent in _getobcontext. This was...

Made container and accessed default to aq_parent in _getobcontext.  This was necessary to make the help system work.
parent 876c3474
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Access control package""" """Access control package"""
__version__='$Revision: 1.126 $'[11:-2] __version__='$Revision: 1.127 $'[11:-2]
import Globals, socket, ts_regex, SpecialUsers import Globals, socket, ts_regex, SpecialUsers
import os import os
...@@ -643,30 +643,21 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager, ...@@ -643,30 +643,21 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
c is the physical container of the object c is the physical container of the object
""" """
n = request.steps[-1] n = request.steps[-1]
# default to accessed and container as v.aq_parent
a = c = request['PARENTS'][0]
# try to find actual container
if hasattr(v, 'aq_parent'): if hasattr(v, 'aq_parent'):
# this is not a method, we needn't treat it specially # this is not a method, we needn't treat it specially
a = v.aq_parent
c = v.aq_inner.aq_parent c = v.aq_inner.aq_parent
elif hasattr(v, 'im_self'): elif hasattr(v, 'im_self'):
# this is a method, we need to treat it specially # this is a method, we need to treat it specially
a = getattr(v.im_self, 'aq_parent', None) try: c = v.im_self.aq_inner.aq_parent
try: except: pass
c = v.im_self.aq_inner.aq_parent
except:
c = None
else:
# punt on setting accessed or container if its neither a
# method nor a regular object or if it's not aq-wrapped.
a = c = None
request_container = getattr(request['PARENTS'][-1], 'aq_parent', []) request_container = getattr(request['PARENTS'][-1], 'aq_parent', [])
if a is request_container: if a is request_container:
# if pub's aq_parent is the request container, it # if pub's aq_parent is the request container, it
# means pub was accessed from and is contained in the root # means pub was accessed from the root
root = request['PARENTS'][-1] a = request['PARENTS'][-1]
a = c = root
return a, c, n, v return a, c, n, v
def _isTop(self): def _isTop(self):
......
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