1

I am trying to delete all the role Assignments of a list Item using REST API in SharePoint 2013 workflow. The REST query returns the response code as OK but the role Assignments are not removed.

Can anyone help me with this?

REST query : 

[%Workflow Context:Current Site URL%]/_api/lists/getbytitle('[%Workflow Context:List Name%]')/items([%Current Item:ID%])/roleassignments

Below is the screenshot

enter image description here enter image description here

1

You need to break role inheritance of the list item here -

try below url:

[%Workflow Context:Current Site URL%]/_api/lists/getbytitle('[%Workflow Context:List Name%]')/items([%Current Item:ID%])/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)
1

Please check the reference URL.

you can get in details and step by step solution to remove and assign the roles i.e Brake Role Inheritance with Rest API.

Hope it will help you.

0

To remove all role assignments you need to break inheritance with options. Your rest call to remove all roles should be similar to this:

url: siteUrl + String.format("/_api/web/lists/getbytitle('" + listTitle + "')/items(" + confidencialDocumentId + )/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)"),

note the copyRoleAssignments=false

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.