Published on

How to Set permissions for a SharePoint list item

Authors

I got question the other day on how to remove permissions on a SharePoint List item using Power Automate so here is a quick guide:

  1. Create an Automated Flow

  2. When an item is created:

Image
  1. Send Http Request to SharePoint (Break List Item Inheritance)
| Name        | Value                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------- |
| *Site Address |https://YOURURL.sharepoint.com/sites/yourSite                                                                                                                 |
| *Method   | POST                                                                                                                     |
| *Uri | _api/web/lists/getByTitle(ListUrl)/items/getById(FileID)/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true) |
Image
  1. Get User Profile(V2):
Image
  1. Send Http Request to SharePoint (Remove User from List item)
| Name        | Value                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------- |
| *Site Address |https://YOURURL.sharepoint.com/sites/yourSite                                                                                                                 |
| *Method   | POST                                                                                                                     |
| *Uri | _api/web/lists/getbytitle(ListUrl)/items(FileID)/roleassignments/removeroleassignment(principalid='userID',roleDefId=1073741827) |
Image
  1. Visit the list item and you can see the inheritence being broken
Image

Whole Flow:

Image