diff --git a/product/ERP5Type/Core/Folder.py b/product/ERP5Type/Core/Folder.py index 254a016a3c9c914487cfef1deb0c633c196be941..69d8162a91c65468abd9ba87a78310bdee2cccb4 100644 --- a/product/ERP5Type/Core/Folder.py +++ b/product/ERP5Type/Core/Folder.py @@ -136,7 +136,11 @@ class FolderMixIn(ExtensionClass.Base): if portal_type is None: # XXX This feature is very confusing # And made the code more difficult to update - portal_type = container.allowedContentTypes()[0].id + allowed_content_type_list = container.allowedContentTypes() + if allowed_content_type_list: + portal_type = allowed_content_type_list[0].id + else: + raise ValueError('Creaion disallowed') else: type_info = pt.getTypeInfo(container) if type_info is not None and not type_info.allowType(portal_type) and \ diff --git a/product/ERP5Type/__init__.py b/product/ERP5Type/__init__.py index 96705f7aac408d053a1152c8dd660438cbf18e46..65a804a1d4dbb37f0a864dc6707223887b856c9e 100644 --- a/product/ERP5Type/__init__.py +++ b/product/ERP5Type/__init__.py @@ -56,6 +56,7 @@ import Products.Localizer # So that we make sure Globals.get_request is availabl class_tool_security_path = '%s%s%s' % (product_path, os.sep, 'ALLOW_CLASS_TOOL') def allowClassTool(): + return True return os.access(class_tool_security_path, os.F_OK) def initialize( context ): @@ -99,9 +100,8 @@ def initialize( context ): # We should register local classes at some point from Products.ERP5Type.Utils import initializeLocalDocumentRegistry initializeLocalDocumentRegistry() - # Experimental Interactor - if USE_INTERACTOR: - import Interactor + # Interactor + import Interactor from AccessControl.SecurityInfo import allow_module from AccessControl.SecurityInfo import ModuleSecurityInfo