I am working on a multisite solution and I need to restrict the block types available to either a specific user group (e.g. editor for site A shouldn't be able to see blocks for site B) or, better, restricted to that particular site.
If I have a SiteAPageData base class that inherits PageData, and another for SiteBPageData, is there a way I can restrict the access to these classes and the blocks that inherit from them?
Any help or code examples would be greatly appreciated, thanks.
This is possible to do in admin mode using groups. Look for the video titled “Making a page type available for only some users” in the help section below:
The same approach can be used to restrict access to blocks in admin mode.
Thanks for your quick and helpful response, David. I can see how I can update the block access as well, which is what I was after. Was hoping there was a code implementation I could use so that any new blocks created on either site will automatically inherit from the base class access level, but this will do the trick. Just need to remember to update the access rights when the block is made. Thanks again.
There's also an Access attribute that can be used to restrict access for a Content type.
[Access(Roles = "SomeRole")]