[Zope3-checkins] SVN: Zope3/trunk/src/zope/ Fix a typo. Make
Unauthorized exception take a name and permission arguments
on constructor,
and fix two places where a message was being passed instead of a name
Sidnei da Silva
sidnei at awkly.org
Fri Jul 9 15:03:38 EDT 2004
Log message for revision 26361:
Fix a typo. Make Unauthorized exception take a name and permission arguments on constructor, and fix two places where a message was being passed instead of a name
-=-
Modified: Zope3/trunk/src/zope/app/publication/traversers.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/traversers.py 2004-07-09 18:32:59 UTC (rev 26360)
+++ Zope3/trunk/src/zope/app/publication/traversers.py 2004-07-09 19:03:38 UTC (rev 26361)
@@ -89,7 +89,7 @@
return getView(ob, name[6:], request)
if name.startswith('_'):
- raise Unauthorized("Name %s begins with an underscore" % `name`)
+ raise Unauthorized, name
subob = getattr(ob, name, self) # self is marker here
if subob is self:
Modified: Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py 2004-07-09 18:32:59 UTC (rev 26360)
+++ Zope3/trunk/src/zope/app/publisher/browser/metaconfigure.py 2004-07-09 19:03:38 UTC (rev 26361)
@@ -81,7 +81,7 @@
"""Create an add menu item for a given class or factory
As a convenience, a class can be provided, in which case, a factory is
- automatically defined baded on the class.
+ automatically defined based on the class.
"""
if class_ is None:
if factory is None:
Modified: Zope3/trunk/src/zope/publisher/base.py
===================================================================
--- Zope3/trunk/src/zope/publisher/base.py 2004-07-09 18:32:59 UTC (rev 26360)
+++ Zope3/trunk/src/zope/publisher/base.py 2004-07-09 19:03:38 UTC (rev 26361)
@@ -469,7 +469,7 @@
def traverseName(self, request, ob, name, check_auth=1):
if name.startswith('_'):
- raise Unauthorized("Name %s begins with an underscore" % `name`)
+ raise Unauthorized, name
if hasattr(ob, name):
subob = getattr(ob, name)
else:
Modified: Zope3/trunk/src/zope/security/checker.py
===================================================================
--- Zope3/trunk/src/zope/security/checker.py 2004-07-09 18:32:59 UTC (rev 26360)
+++ Zope3/trunk/src/zope/security/checker.py 2004-07-09 19:03:38 UTC (rev 26361)
@@ -128,7 +128,7 @@
permission = self.set_permissions.get(name)
else:
permission = None
-
+
if permission is not None:
if permission is CheckerPublic:
return # Public
@@ -138,7 +138,7 @@
return
else:
__traceback_supplement__ = (TracebackSupplement, object)
- raise Unauthorized, name
+ raise Unauthorized(name=name, permission=permission)
__traceback_supplement__ = (TracebackSupplement, object)
raise ForbiddenAttribute, (name, object)
@@ -155,7 +155,7 @@
return
else:
__traceback_supplement__ = (TracebackSupplement, object)
- raise Unauthorized, name
+ raise Unauthorized(name=name, permission=permission)
elif name in _always_available:
return
More information about the Zope3-Checkins
mailing list