In this article I’m going to explain about how we break item permission inheritance when the item is added by using SharePoint REST API and SharePoint Designer Workflow 2013.
Introduction
By default, breaking permission inheritance and replacing item permission are not available in SharePoint Workflow 2013.
While using SharePoint Workflow 2010 we are not supposed to save the workflow as a template and we cannot use it in another site collection.
Now I’m going to use SharePoint REST APIs to break roles and permissions inheritance.
SharePoint Designer Workflow 2013 to Break Item Permission Inheritance
Step1
First of all, I’m going to create a new SharePoint workflow 2013 against a SharePoint list that needs to update permissions to the user, based on item level.
Step 2
The workflow should be triggered after the item is added.
Step 3
Initially we need context info to call the POST APIs. Create the variable contextHeader as dictionary and set service call header to get context info.
Step 4
Create the variable contextUrl as string to set service URL.
Step 5
Call the REST API service as POST method
Then read the FormDigestValue from the context response.
Step 6
Create the variable requestHeader as dictionary.
Then create the variable breakInheritanceAPIUrl as string.
Step 7
Call the service to break the inheritance permissions to the current item.
The Permission inheritance is stopped for the current item after successful service response.
In the next article, we will see how to read and remove all permissions to the current item.
References
https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListItemBreakRoleInheritance
Summary
In this article, we have explored how to break inheritance permission from the parent to item by using SharePoint Workflow 2013 and REST API.