1

I have a SharePoint Online farm. I am trying to break inheritance on a folder in a document library, and then assign permissions to user(s), all via the REST API.

I can run this command successfully (a folder object is returned):

https://mysite/_api/web/GetFolderByServerRelativeUrl('/DocLib/folder1')/

But when I try to run this command I get a 403 Forbidden error:

https://mysite/_api/web/GetFolderByServerRelativeUrl('/DocLib/folder1')/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)

What am I missing here?

1 Answer 1

1

According to https://sharepoint.stackexchange.com/a/113322/47068 you need change

https://mysite/_api/web/GetFolderByServerRelativeUrl('/DocLib/folder1')/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)

to

https://mysite/_api/web/GetFolderByServerRelativeUrl('/DocLib/folder1')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)
2
  • This still generates a 403 Forbidden error. Commented Mar 20, 2017 at 19:37
  • I was getting the 403 because I was using https on my REST call. I switched to http and it all worked fine. Commented Mar 20, 2017 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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