[Zope3-checkins] CVS: Zope3/src/zope/app/browser/exception - unauthorized.pt:1.6 unauthorized.py:1.8

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Mar 8 07:06:53 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/browser/exception
In directory cvs.zope.org:/tmp/cvs-serv13053/src/zope/app/browser/exception

Modified Files:
	unauthorized.pt unauthorized.py 
Log Message:


Adjusted code to use the new APIs for permissions and principals. Also, use
the utility service instead of the permission registry to look up permissions.




=== Zope3/src/zope/app/browser/exception/unauthorized.pt 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/exception/unauthorized.pt:1.5	Tue Dec 23 10:23:11 2003
+++ Zope3/src/zope/app/browser/exception/unauthorized.pt	Mon Mar  8 07:05:52 2004
@@ -1,4 +1,4 @@
-<tal:Make_sure_we_process_the_authorization_chalenge_first
+<tal:Make_sure_we_process_the_authorization_challenge_first
   condition="view/issueChallenge"
   /><html metal:use-macro="context/@@standard_macros/page">
 <body>


=== Zope3/src/zope/app/browser/exception/unauthorized.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/exception/unauthorized.py:1.7	Fri Mar  5 17:08:54 2004
+++ Zope3/src/zope/app/browser/exception/unauthorized.py	Mon Mar  8 07:05:52 2004
@@ -15,24 +15,22 @@
 
 $Id$
 """
-from zope.app.traversing import getParent
-from zope.app.interfaces.security import IAuthenticationService
+from zope.app import zapi
+from zope.app.security.interfaces import IAuthenticationService
 
-__metaclass__ = type
 
-
-class Unauthorized:
+class Unauthorized(object):
 
     def issueChallenge(self):
         # Set the error status to 403 (Forbidden) in the case when we don't
         # challenge the user
         self.request.response.setStatus(403)
         principal = self.request.user
-        prinreg = getParent(principal)
+        prinreg = zapi.getParent(principal)
         if not IAuthenticationService.providedBy(prinreg):
             # With PluggableAuthenticationService, principals are
             # contained in the PrincipalSource, which is contained in
             # the service.
-            prinreg = getParent(prinreg)
+            prinreg = zapi.getParent(prinreg)
         assert IAuthenticationService.providedBy(prinreg)
-        prinreg.unauthorized(principal.getId(), self.request)
+        prinreg.unauthorized(principal.id, self.request)




More information about the Zope3-Checkins mailing list