I have 30-40 sharepoint library files and I need a way to bulk set permissions on them based on a sharepoint group. Ex, in pictures:
When I click Manage access,
I want to give access to just this group but I have to go through every single other group manually. So for ALL of these, of course that’s a TON of clicks. I figure if I can use the API to do this I’ll save a ton of time, learn something I can use in the future and eliminate a lot of possible mistakes. Everything I see on the google machine is about providing access to LISTS so I’m getting lost trying to find how to get to the actual folder itself. Luckily, I’m actually creating the folders in a flow so I think if I can capture the information there and do it right after I create it, that’s the secret.
Here’s what I’ve come up with so far…I wrote in an HTTP GET request just to see if I could get to the folder. I succeeded there by using :
This process fine and I get a response that shows me the folder I’m looking for:
But here’s where I am lost. I don’t know what to DO with it. I found something on the Google box that said I could clear all permissions with “/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)” after the API call. So I tried it:
So this error says it cant find the resource. So…rats. Any suggestions I could try?
In SharePoint, folder is an item so you should be able to break inheritance with HTTP Request Post action in flow.
Try below first on a browser by replacing SiteUrl, LibName and FolderName with your site info - please note, SiteUrl includes up to sub-site if you have one.
Once you get above URL to return data in browser simply construct the URL in HTTP Post Action in flow and see if it resolves the issue.
Thanks for the suggestion, Uday, but the same thing happens here. I am able to GET to the folder just fine. Like,if instead of a "POST" I just try to GET the name of the folder, I can do that and store it off just fine.
The issue at hand is how do I take action on the folder? Can I clear the permissions and add new ones? Here is the solution that works on a LIST:
In this post you will find a similar question, and a very helpful answer by @abm : https://powerusers.microsoft.com/t5/Building-Flows/How-do-I-add-permissions-to-folder-after-it-is-cr...
You should use this expression to break role inheritance:
By the expression you shared, you should use the following:
Hope it helps!
@TP3_Altice - this is what I had to do, hope this helps. (slightly different than what I initially suggested). I also included an option for user, not just SP Group.
Read the announcement for more information!
Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
The top training and networking event across the globe for Microsoft Business Applications