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.
We will first configure the access rights in the Sitecore configuration:
In the
\App_Config\include\Cookbook
folder, create a patch configuration file,SitecoreCookbook.CustomAccessRights.config
. In the<configuration/sitecore/accessRights>
section, create anitem:publish
custom right as follows:<accessRights> <rights> <add name="item:publish...