[Zope3-checkins] CVS: Zope3/src/zope/app/publication - zopepublication.py:1.36.2.2

Marius Gedminas marius at pov.lt
Fri Mar 19 13:51:23 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/publication
In directory cvs.zope.org:/tmp/cvs-serv26650/src/zope/app/publication

Modified Files:
      Tag: mgedmin-events2-branch
	zopepublication.py 
Log Message:
Added IParticipation and replaced the lists of principals in IInteraction with
a list of participations.  Made BaseRequest an IParticipation and replaced
request.user with request.principal everywhere.



=== Zope3/src/zope/app/publication/zopepublication.py 1.36.2.1 => 1.36.2.2 ===
--- Zope3/src/zope/app/publication/zopepublication.py:1.36.2.1	Mon Mar  8 13:43:38 2004
+++ Zope3/src/zope/app/publication/zopepublication.py	Fri Mar 19 13:50:47 2004
@@ -24,7 +24,6 @@
 from zope.publisher.interfaces.http import IHTTPRequest
 
 from zope.security.checker import ProxyFactory
-from zope.security.management import getInteraction
 from zope.security.management import newInteraction, endInteraction
 
 from zope.proxy import removeAllProxies
@@ -74,12 +73,12 @@
             if p is None:
                 raise Unauthorized # If there's no default principal
 
-        request.setUser(p)
+        request.setPrincipal(p)
         newInteraction(request)
         get_transaction().begin()
 
     def _maybePlacefullyAuthenticate(self, request, ob):
-        if not IUnauthenticatedPrincipal.isImplementedBy(request.user):
+        if not IUnauthenticatedPrincipal.isImplementedBy(request.principal):
             # We've already got an authenticated user. There's nothing to do.
             # Note that beforeTraversal guarentees that user is not None.
             return
@@ -103,10 +102,7 @@
                 # nothing to do here
                 return
 
-        # XXX we discussed IInteraction.afterLocalAuthentication(old_principal, new_principal, site)
-        getInteraction().remove(request.user)
-        request.setUser(principal)
-        getInteraction().add(request.user)
+        request.setPrincipal(principal)
 
     def callTraversalHooks(self, request, ob):
         # Call __before_publishing_traverse__ hooks
@@ -158,7 +154,7 @@
         if IHTTPRequest.isImplementedBy(request):
             txn.note(request["PATH_INFO"])
         # XXX not sure why you would use id vs title or description
-        txn.setUser(request.user.getId())
+        txn.setUser(request.principal.getId())
         # Make sure the interaction is ended
         try: endInteraction()
         except: pass # XXX I do not like this except clause, but it makes tests pass




More information about the Zope3-Checkins mailing list