How to change existing dexterity types and behaviors

Yes, you can

from plone.autoform.interfaces import IFormFieldProvider
from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY
from plone.supermodel.interfaces import ISchemaPlugin
from zope.component import adapter
from zope.interface import implementer


@implementer(ISchemaPlugin)
@adapter(IFormFieldProvider)
class SchemaTweaks:

    order = 999999

    def __init__(self, schema):
        self.schema = schema

    def __call__(self):
        if self.schema.getName() == "IRelatedItems":
            try:
                write_permissions = self.schema.getTaggedValue(WRITE_PERMISSIONS_KEY)
            except KeyError:
                write_permissions = {}
            write_permissions["relatedItems"] = "cmf.ManagePortal"
            self.schema.setTaggedValue(WRITE_PERMISSIONS_KEY, write_permissions)

1 Like

The adapter registration is enough to enable the tweak, thanks @pbauer! It works as expected.