[Zope-Checkins]
SVN: Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py
Moved the roles checking outside the name traversal.
Lennart Regebro
regebro at gmail.com
Wed Apr 19 04:47:39 EDT 2006
Log message for revision 67116:
Moved the roles checking outside the name traversal.
Changed:
U Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py
-=-
Modified: Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py
===================================================================
--- Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py 2006-04-19 06:48:06 UTC (rev 67115)
+++ Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py 2006-04-19 08:47:39 UTC (rev 67116)
@@ -185,7 +185,6 @@
def traverseName(self, object, entry_name):
- got = 0
URL=self['URL']
if entry_name[:1]=='_':
raise Forbidden("Object name begins with an underscore at: %s" % URL)
@@ -200,7 +199,6 @@
try:
subobject=getattr(object, entry_name)
except AttributeError:
- got=1
subobject=object[entry_name]
# Ensure that the object has a docstring, or that the parent
@@ -227,10 +225,6 @@
"The object at %s is not publishable." % URL
)
- self.roles = getRoles(
- object, (not got) and entry_name or None, subobject,
- self.roles)
- print self.roles
return subobject
@@ -362,7 +356,17 @@
request['URL'] = URL = '%s/%s' % (request['URL'], step)
try:
- object = self.traverseName(object, entry_name)
+ subobject = self.traverseName(object, entry_name)
+ if (hasattr(object,'__bobo_traverse__') or
+ hasattr(object, entry_name)):
+ check_name = entry_name
+ else:
+ check_name = None
+
+ self.roles = getRoles(
+ object, check_name, subobject,
+ self.roles)
+ object = subobject
except (KeyError, AttributeError):
if response.debug_mode:
return response.debugError(
More information about the Zope-Checkins
mailing list