documentation
documentation copied to clipboard
plone/content/creating.html outdated for dexterity content (folder restrictions)
https://5.docs.plone.org/develop/plone/content/creating.html#restricting-available-types-per-folder-instance
covers folder restrictions only for AT content but no support for Dexterity content.
The API for DX content is similar and available through an adapter:
from Products.CMFPlone.interfaces import ISelectableConstrainTypes
aspect = ISelectableConstrainTypes(self.context)
aspect.setConstrainTypesMode(data['constrain_types_mode'])
aspect.setLocallyAllowedTypes(allowed_types)
aspect.setImmediatelyAddableTypes(immediately_addable)