[Zope3-checkins] SVN: Zope3/trunk/src/zope/security/management.py Added a debugging api to restore the last interaction.

Jim Fulton jim at zope.com
Thu Jul 22 12:33:28 EDT 2004


Log message for revision 26683:
  
  Added a debugging api to restore the last interaction.
    This is helpful when doing post-mortem debugging, since the 
    interaction has been cleared.
  
  


Changed:
  U   Zope3/trunk/src/zope/security/management.py


-=-
Modified: Zope3/trunk/src/zope/security/management.py
===================================================================
--- Zope3/trunk/src/zope/security/management.py	2004-07-22 16:33:25 UTC (rev 26682)
+++ Zope3/trunk/src/zope/security/management.py	2004-07-22 16:33:27 UTC (rev 26683)
@@ -95,10 +95,14 @@
     """End the current interaction."""
 
     try:
-        del thread_local.interaction
+        thread_local.previous_interaction = thread_local.interaction
     except AttributeError:
         pass
+    else:
+        del thread_local.interaction
 
+def restoreInteraction():
+    thread_local.interaction = thread_local.previous_interaction
 
 def checkPermission(permission, object, interaction=None):
     """Return whether security policy allows permission on object.



More information about the Zope3-Checkins mailing list