I have recently received a request from a customer to break the inherited permissions of a SharePoint document library folder, as of now there is no Power Automate action to break the permission of a folder but with the action Send an HTTP request to SharePoint you can call any SP REST API endpoint. Then I started exploring the Rest API endpoint to break the permission, have found the API endpoint
I was trying to understand the method breakroleinheritance() in the endpoint and its parameters. This method passes two Boolean parameters, copyRoleAssignments and clearSubScopes.
- copyRoleAssignments parameter specifies whether to maintain the current role assignments already inherited from the parent site collection or Web site or List/Library,
- clearSubScopes parameter specifies whether to clear unique permissions of child objects so that they will subsequently inherit permissions from the parent Web site or list
So how to know that the method breakroleinheritance() accepts two parameters
- Documentation from Microsoft
- API Metadata document
The metadata document ($metadata) is published at the service root for SharePoint & Graph API (v1.0 & beta versions). It describes about endpoints, methods, parameters, properties, associations etc
SharePoint Online API Metadata:
To access the metadata document for SharePoint REST service, hit the following URL from the browser after authentication
The response to the request will be an XML document. If I search on the XML file for breakroleinheritance, I found the following information
It will not give you information about the HTTP method [GET, POST, PUT etc] to use but it will provide you some insights on the API metadata. I understand it is difficult to search the XML document, a big shout out to Sergei Sergeev who has created an excellent project SharePoint REST API Metadata Explorer to handle the difficulty. Find the link below to access the project
As per the information on the project, the metadata is getting updated daily.
MS Graph API Metadata:
Microsoft Graph API v1.0 metadata
Microsoft Graph API beta metadata
The response metadata will be in JSON.
Hope this helps someone. Sharing is Caring.