[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/session/ Bugfix, addded missing location, otherwise ends in broken ZMI access

Roger Ineichen roger at projekt01.ch
Sun Jun 4 12:37:50 EDT 2006


Log message for revision 68487:
  Bugfix, addded missing location, otherwise ends in broken ZMI access 
  because of missing IPhysicallyLocatable adapter.
  - Added location back since ILocalUtility interface 
  is gone in this classes.
  - Added right permission for ILocation

Changed:
  U   Zope3/trunk/src/zope/app/session/configure.zcml
  U   Zope3/trunk/src/zope/app/session/http.py
  U   Zope3/trunk/src/zope/app/session/session.py

-=-
Modified: Zope3/trunk/src/zope/app/session/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/session/configure.zcml	2006-06-04 15:12:17 UTC (rev 68486)
+++ Zope3/trunk/src/zope/app/session/configure.zcml	2006-06-04 16:37:50 UTC (rev 68487)
@@ -38,6 +38,12 @@
     <require
         set_schema=".http.ICookieClientIdManager"
         permission="zope.ManageServices" />
+    <require
+        interface="zope.location.ILocation"
+        permission="zope.Public" />
+    <require
+        set_schema="zope.location.ILocation"
+        permission="zope.ManageServices" />
   </class>
 
   <class class=".session.PersistentSessionDataContainer">
@@ -47,6 +53,12 @@
     <require
         set_schema=".interfaces.ISessionDataContainer"
         permission="zope.ManageServices" />
+    <require
+        interface="zope.location.ILocation"
+        permission="zope.Public" />
+    <require
+        set_schema="zope.location.ILocation"
+        permission="zope.ManageServices" />
   </class>
 
   <class class=".session.RAMSessionDataContainer">
@@ -56,6 +68,12 @@
     <require
         set_schema=".interfaces.ISessionDataContainer"
         permission="zope.ManageServices" />
+    <require
+        interface="zope.location.ILocation"
+        permission="zope.Public" />
+    <require
+        set_schema="zope.location.ILocation"
+        permission="zope.ManageServices" />
   </class>
 
   <class class=".session.SessionData">

Modified: Zope3/trunk/src/zope/app/session/http.py
===================================================================
--- Zope3/trunk/src/zope/app/session/http.py	2006-06-04 15:12:17 UTC (rev 68486)
+++ Zope3/trunk/src/zope/app/session/http.py	2006-06-04 16:37:50 UTC (rev 68487)
@@ -23,6 +23,7 @@
 import time
 from cStringIO import StringIO
 
+import zope.location
 from persistent import Persistent
 from zope import schema
 from zope.interface import implements
@@ -70,13 +71,11 @@
             missing_value=None,
             )
 
-class CookieClientIdManager(Persistent):
+class CookieClientIdManager(zope.location.Location, Persistent):
     """Session utility implemented using cookies."""
 
     implements(IClientIdManager, ICookieClientIdManager, IAttributeAnnotatable)
 
-    __parent__ = __name__ = None
-
     def __init__(self):
         self.namespace = "zope3_cs_%x" % (int(time.time()) - 1000000000)
         self.secret = "%.20f" % random.random()

Modified: Zope3/trunk/src/zope/app/session/session.py
===================================================================
--- Zope3/trunk/src/zope/app/session/session.py	2006-06-04 15:12:17 UTC (rev 68486)
+++ Zope3/trunk/src/zope/app/session/session.py	2006-06-04 16:37:50 UTC (rev 68487)
@@ -22,6 +22,7 @@
 
 import ZODB
 import ZODB.MappingStorage
+import zope.location
 from persistent import Persistent
 from BTrees.OOBTree import OOBTree
 
@@ -68,9 +69,9 @@
                 )
 
 
-class PersistentSessionDataContainer(Persistent, IterableUserDict):
+class PersistentSessionDataContainer(zope.location.Location, Persistent, 
+    IterableUserDict):
     """A SessionDataContainer that stores data in the ZODB"""
-    __parent__ = __name__ = None
 
     implements(ISessionDataContainer, IAttributeAnnotatable)
 



More information about the Zope3-Checkins mailing list