Commit aca22447 authored by Ivan Tyagov's avatar Ivan Tyagov

Allow import of various exceptions in restricted environment

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14834 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 527eff9b
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
# Update ERP5 Globals # Update ERP5 Globals
from Products.ERP5Type.Utils import initializeProduct, updateGlobals from Products.ERP5Type.Utils import initializeProduct, updateGlobals
from AccessControl.SecurityInfo import allow_module
import sys, Permissions import sys, Permissions
this_module = sys.modules[ __name__ ] this_module = sys.modules[ __name__ ]
document_classes = updateGlobals( this_module, globals(), permissions_module = Permissions) document_classes = updateGlobals( this_module, globals(), permissions_module = Permissions)
...@@ -58,4 +59,9 @@ def initialize( context ): ...@@ -58,4 +59,9 @@ def initialize( context ):
portal_tools = portal_tools, portal_tools = portal_tools,
content_constructors = content_constructors, content_constructors = content_constructors,
content_classes = content_classes) content_classes = content_classes)
# allow import of various exceptions in restricted environment
# so we can catch them in ZODB scripts and inform user nicely
allow_module('Products.ERP5.Document.Document.ConversionError')
allow_module('xmlrpclib.Fault')
allow_module('socket.error')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment