How to Set permissions for a SharePoint list item
April 5, 2022
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:
-
Create an Automated Flow
-
When an item is created:
- 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) |
- Get User Profile(V2):
The user that not allowed to see this UPN/Mail
- 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) |
- Visit the list item and you can see the inheritence being broken
Whole Flow: