src/ztfy/utils/zodb.py
branchZTK-1.1
changeset 242 ffa98c18e909
parent 181 3bdaee25ec3a
child 277 35f11f1758e9
--- a/src/ztfy/utils/zodb.py	Tue Dec 03 11:47:15 2013 +0100
+++ b/src/ztfy/utils/zodb.py	Thu Dec 05 11:58:08 2013 +0100
@@ -36,6 +36,8 @@
 from zope.interface import implementer, implements, classProvides
 from zope.schema import getFieldNames
 from zope.schema.fieldproperty import FieldProperty
+from zope.security.proxy import removeSecurityProxy
+
 
 # import local packages
 
@@ -122,8 +124,8 @@
 @adapter(IPersistent)
 @implementer(ITransactionManager)
 def transactionManager(obj):
-    conn = IConnection(obj) # typically this will be
-                            # zope.app.keyreference.persistent.connectionOfPersistent
+    conn = IConnection(removeSecurityProxy(obj))  # typically this will be
+                                                  # zope.app.keyreference.persistent.connectionOfPersistent
     try:
         return conn.transaction_manager
     except AttributeError: