Commit 266903f8 authored by Aurel's avatar Aurel

add parameter check_allowed to newContent in order to say if we want to check...

add parameter check_allowed to newContent in order to say if we want to check allowed content type on portal type or not

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