Creating custom access rights for an item
Sitecore's standard authorization model provides you with the ability to control permissions based on the item, field, language, site, and workflow. An item has different access rights such as read, write, delete, and so on. Most of the time, these access rights are enough to match all requirements. Sometimes, we might need to create our own custom access rights to meet business requirements.
In this recipe, we will create a custom access right to control the publishing of users. So, before publishing, we will use APIs to find out whether the user has publishing rights or not.
How to do it…
We will first configure the access rights in the Sitecore configuration:
- In the
\App_Config\include\Cookbook
folder, ...
Get Sitecore Cookbook for Developers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.