origin = aq_parent(aq_inner(self))
origin.setConstrainTypesMode(constraintypes.ENABLED)
org_types = origin.getLocallyAllowedTypes()
new_types = [x for x in org_types].append(self.portal_type)
origin.setLocallyAllowedTypes(new_types)
Limiting one Content item per Member in a Folder on Plone 4