[Zope3-checkins] SVN: Zope3/trunk/src/zope/security/_zope_security_checker.c Changed to include permission in Unauthorized errors, as was done in

Jim Fulton jim at zope.com
Thu Jul 22 12:33:30 EDT 2004


Log message for revision 26684:
  
  Changed to include permission in Unauthorized errors, as was done in
    Python.
  


Changed:
  U   Zope3/trunk/src/zope/security/_zope_security_checker.c


-=-
Modified: Zope3/trunk/src/zope/security/_zope_security_checker.c
===================================================================
--- Zope3/trunk/src/zope/security/_zope_security_checker.c	2004-07-22 16:33:27 UTC (rev 26683)
+++ Zope3/trunk/src/zope/security/_zope_security_checker.c	2004-07-22 16:33:29 UTC (rev 26684)
@@ -94,8 +94,12 @@
         return 0;
 /*             else: */
 /*                 __traceback_supplement__ = (TracebackSupplement, object) */
-/*                 raise Unauthorized, name */
-      PyErr_SetObject(Unauthorized, name);
+/*                 raise Unauthorized(name, permission) */
+      r = Py_BuildValue("OO", name, permission);
+      if (r == NULL)
+        return -1;
+      PyErr_SetObject(Unauthorized, r);
+      Py_DECREF(r);
       return -1;
 }
 



More information about the Zope3-Checkins mailing list