Allowing/restricting content types dynamically?

Vote:
 

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.

Edit

I think I should be able to create MetadataExtender that sets the AllowedTypes property. Is this right?

#224074
Edited, Jun 10, 2020 16:42
Vote:
 

Hi Jerzy

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. 

David

#224082
Jun 10, 2020 18:57
Vote:
 

Ps Dejan has a nice write up on using Virtual Roles here: https://www.dcaric.com/blog/virtual-roles-in-episerver

#224083
Jun 10, 2020 19:41
Vote:
 

Allan has a nice writeup that can help as well

#224104
Jun 11, 2020 8:17
David Knipe - Jun 11, 2020 8:20
Thanks Jeroen, even better when someone has written the whole thing up :)!
Vote:
 

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.

#224228
Jun 15, 2020 7:08
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.