[Zope3-checkins] CVS: Zope3/src/zope/security - checker.py:1.44.2.1

Sidnei da Silva sidnei at awkly.org
Wed Mar 3 14:57:38 EST 2004


Update of /cvs-repository/Zope3/src/zope/security
In directory cvs.zope.org:/tmp/cvs-serv17718/security

Modified Files:
      Tag: runyaga-sip-branch
	checker.py 
Log Message:
Pass permission to Unauthorized exception, so we can display it if we wish to.


=== Zope3/src/zope/security/checker.py 1.44 => 1.44.2.1 ===
--- Zope3/src/zope/security/checker.py:1.44	Tue Feb 24 09:01:33 2004
+++ Zope3/src/zope/security/checker.py	Wed Mar  3 14:57:37 2004
@@ -148,7 +148,8 @@
                 return
             else:
                 __traceback_supplement__ = (TracebackSupplement, object)
-                raise Unauthorized, name
+                needed = {'permission': permission}
+                raise Unauthorized(name, needed=needed)
 
         __traceback_supplement__ = (TracebackSupplement, object)
         raise ForbiddenAttribute, (name, object)
@@ -164,7 +165,8 @@
                 return
             else:
                 __traceback_supplement__ = (TracebackSupplement, object)
-                raise Unauthorized, name
+                needed = {'permission': permission}
+                raise Unauthorized(name, needed=needed)
         elif name in _always_available:
             return
 
@@ -308,7 +310,8 @@
                 return
             else:
                 __traceback_supplement__ = (TracebackSupplement, object)
-                raise Unauthorized, name
+                needed = {'permission': permission}
+                raise Unauthorized(name, needed=needed)
         else:
             # let the original checker decide
             self._original_checker.check(object, name)
@@ -325,7 +328,8 @@
                 return
             else:
                 __traceback_supplement__ = (TracebackSupplement, object)
-                raise Unauthorized, name
+                needed = {'permission': permission}
+                raise Unauthorized(name, needed=needed)
         else:
             # let the original checker decide
             self._original_checker.check_getattr(object, name)
@@ -342,7 +346,8 @@
                 return
             else:
                 __traceback_supplement__ = (TracebackSupplement, object)
-                raise Unauthorized, name
+                needed = {'permission': permission}
+                raise Unauthorized(name, needed=needed)
         else:
             # let the original checker decide
             self._original_checker.check_setattr(object, name)




More information about the Zope3-Checkins mailing list