Commit 518fb00c authored by Aurel's avatar Aurel

remove paramater check allowed, instead check if we are in trash tool when content not allowed

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13912 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 74e56582
......@@ -74,7 +74,7 @@ class FolderMixIn(ExtensionClass.Base):
def newContent(self, id=None, portal_type=None, id_group=None,
default=None, method=None, immediate_reindex=0,
container=None, created_by_builder=0, activate_kw=None,
is_indexable=None, temp_object=0, check_allowed=1, **kw):
is_indexable=None, temp_object=0, **kw):
"""Creates a new content.
This method is public, since TypeInformation.constructInstance will perform
the security check.
......@@ -103,8 +103,9 @@ class FolderMixIn(ExtensionClass.Base):
return m(container, new_id)
myType = pt.getTypeInfo(container)
if myType is not None and check_allowed == 1:
if myType is not None:
if not myType.allowType( portal_type ):
if not 'portal_trash' in container.getPath():
raise ValueError('Disallowed subobject type: %s' % portal_type)
pt.constructContent( type_name=portal_type,
......
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