Forum Discussion
Ashwin Kheta
Nov 07, 2017Copper Contributor
2013 Workflow BreakRoleInheritance is not applying(working) properly
- I have created workflow (Platform Type: SharePoint 2013 workflow) using SharePoint designer 2013.
- In this workflow I had to change the item level permissions for the item on which this workflow would be running
- And also need to change the item level permissions on the workflow task created through it.
- Prior to this August the workflow was running absolutely fine but suddenly the break role inheritance just stopped working and the workflow didn't work as expected.
- The item is accessible to all site members but this should not be the case as I tried to make it editable only by the creator of that item and his/her Manager.
- Also, the tasks are being assigned to a specific group say approver group so to make the task assigned to be editable by only approver group members I had again used the break role inheritance to achieve this
- The workflow actions are as follows:
- To break the role inheritance: - [%Workflow Context:Current Site URL%]/_api/web/lists/getbytitle('[%Workflow Context:List Name%]')/items('[%Current Item:ID%]')/breakroleinheritance(copyroleassignments=false, clearsubscopes=true)
- called this using http web services call action using POST method
- supplied the request header digest along with Accept and Content-Type in the Request Header
- To assign role/permissions to the item: - [%Workflow Context:Current Site URL%]/_api/web/lists/getbytitle('[%Workflow Context:List Name%]')/items('[%Current Item:ID%]')/roleassignments/addroleassignment(principalid='[%Workflow Context:Initiator%]',roledefid='[%Variable: ContributeRoleDefId%]')
- In this the contribute role definition id is obtained using http GET method and stored in the ContributeRoleDefId variable and assigned using POST method.
- all others are assigned the read role definition id.
- To break the role inheritance: - [%Workflow Context:Current Site URL%]/_api/web/lists/getbytitle('[%Workflow Context:List Name%]')/items('[%Current Item:ID%]')/breakroleinheritance(copyroleassignments=false, clearsubscopes=true)
Need a reason why this is happening and how to solve this issue.
- Dean_GrossSilver Contributor
I would recommend opening a support ticket.
- Dimitri AyrapetovBrass Contributor
Hi Dean, we opened a support ticket but the support team rejected it because they classified it as developer support, even though this is a bug in an OOTB web service.
- Kerem Yuceturk
Microsoft
Hi Dimitri Ayrapetov, Ashwin Kheta, does this also fail outside of the workflow context? Or only when you use it from within workflows?
- Dimitri AyrapetovBrass Contributor
I'm able to reproduce this in my tenant as well. It appears to be a bug in O365.
- Dimitri AyrapetovBrass Contributor
Alina Skarbovsky Is there any chance you could help?
- Alina Skarbovsky
Microsoft
Sorry, not my area of expertise, maybe Kerem Yuceturk can help with this.