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

Albertas Agejevas alga@codeworks.lt
Fri, 18 Jul 2003 10:00:26 -0400


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

Modified Files:
	unauthorized.py 
Log Message:
Fixed breakage of the unauthorized view with the pluggable auth
service.


=== Zope3/src/zope/app/browser/exception/unauthorized.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/exception/unauthorized.py:1.4	Mon Mar 24 05:42:09 2003
+++ Zope3/src/zope/app/browser/exception/unauthorized.py	Fri Jul 18 10:00:22 2003
@@ -31,5 +31,10 @@
         self.request.response.setStatus(403)
         principal = self.request.user
         prinreg = getParent(principal)
+        if not IAuthenticationService.isImplementedBy(prinreg):
+            # With PluggableAuthenticationService, principals are
+            # contained in the PrincipalSource, which is contained in
+            # the service.
+            prinreg = getParent(prinreg)
         assert IAuthenticationService.isImplementedBy(prinreg)
         prinreg.unauthorized(principal.getId(), self.request)