It's fairly straightforward to allow/restrcict certain content types to be added to content area through attributes.
Is is it possible to control allowed/restricted content types dynamically, for example based on some other property?
Something that is really close to the OOTB look & feel as a result, allowing user to drag allowed types, not highlighting if not allowed type is dragged over etc.
I think I should be able to create MetadataExtender that sets the AllowedTypes property. Is this right?
it depends on the use case I guess. I've not tried the approach but a virtual role could be suitable depending on how the external property is configured. https://world.episerver.com/documentation/developer-guides/CMS/security/Virtual-roles/
This allows to determine membership of the virtual role programmatically.
Ps Dejan has a nice write up on using Virtual Roles here: https://www.dcaric.com/blog/virtual-roles-in-episerver
Allan has a nice writeup that can help as well
I was thinking about a bit different use-case. My use would be that admin would enable/disable certain types of block on page instance. E.g. there is multi-select in Admin tab and they can select what block can be added. Then editors could DnD block of those type on this page instance.
Technically editors can create all types of blocks anyway, but what they can add to a page at a given time is controlled per page instance.