[Zope3-checkins] CVS: Zope3/src/zope/app - _app.py:1.16.2.2

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


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

Modified Files:
      Tag: mgedmin-events2-branch
	_app.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/_app.py 1.16.2.1 => 1.16.2.2 ===
--- Zope3/src/zope/app/_app.py:1.16.2.1	Mon Mar  8 13:43:35 2004
+++ Zope3/src/zope/app/_app.py	Fri Mar 19 13:50:09 2004
@@ -21,10 +21,20 @@
 from zope.publisher.publish import publish as _publish, debug_call
 from zope.publisher.browser import TestRequest
 from zope.app.publication.browser import BrowserPublication
+from zope.security.interfaces import IParticipation
+from zope.security.management import system_user
+from zope.interface import implements
 
 __metaclass__ = type
 
 
+class SystemConfigurationParticipation:
+    implements(IParticipation)
+
+    principal = system_user
+    interaction = None
+
+
 _configured = 0
 def config(file, execute=True):
     "Configure site globals"
@@ -36,10 +46,8 @@
     from zope.configuration import xmlconfig
 
     # Set user to system_user, so we can do anything we want
-    from zope.security.management import system_user
-    from zope.security.management import newInteraction, getInteraction
-    newInteraction(None) # XXX perhaps use a special SystemConfigurationRequest
-    getInteraction().add(system_user)
+    from zope.security.management import newInteraction
+    newInteraction(SystemConfigurationParticipation())
 
     # Load server-independent site config
     context = xmlconfig.file(file, execute=execute)




More information about the Zope3-Checkins mailing list