[Zope-Checkins] CVS: Zope/lib/python/Products/Transience - Transience.py:1.28.6.5

Brian Lloyd brian at zope.com
Wed Jan 21 14:58:47 EST 2004


Update of /cvs-repository/Zope/lib/python/Products/Transience
In directory cvs.zope.org:/tmp/cvs-serv32172/Products/Transience

Modified Files:
      Tag: Zope-2_6-branch
	Transience.py 
Log Message:
fix sc loss bug


=== Zope/lib/python/Products/Transience/Transience.py 1.28.6.4 => 1.28.6.5 ===
--- Zope/lib/python/Products/Transience/Transience.py:1.28.6.4	Tue Jan 21 02:56:51 2003
+++ Zope/lib/python/Products/Transience/Transience.py	Wed Jan 21 14:58:46 2004
@@ -27,7 +27,8 @@
 from Persistence import Persistent
 from Acquisition import Implicit
 from AccessControl import ClassSecurityInfo, getSecurityManager
-from AccessControl.SecurityManagement import newSecurityManager
+from AccessControl.SecurityManagement import newSecurityManager, \
+     setSecurityManager
 from AccessControl.User import nobody
 from BTrees.OOBTree import OOBTree, OOBucket, OOSet
 from BTrees.IOBTree import IOBTree
@@ -276,8 +277,9 @@
 
         for item in items:
             if callable(method):
+                sm = getSecurityManager()
                 try:
-                    user = getSecurityManager().getUser()
+                    user = sm.getUser()
                     try:
                         newSecurityManager(None, nobody)
                         method(item, self)
@@ -291,7 +293,7 @@
                             error=sys.exc_info()
                             )
                 finally:
-                    newSecurityManager(None, user)
+                    setSecurityManager(sm)
             else:
                 err = '%s in %s attempted to call non-callable %s'
                 path = self.getPhysicalPath()




More information about the Zope-Checkins mailing list