I have a reasonably simple Flow in Power Automate that creates a site using an HTTP request. Then creates a document library using an HTTP request, but the part I cannot resolve is how to set custom permissions on that document library. I have found a thousand solutions to set permissions on folders and items, which I have done on other projects, but I cannot resolve how to set the permissions on the new document library as a whole.
Any thoughts? I have attached a picture of my working "Create Library" request.
The REST calls are the same, just replace the library name parameter you see in the replies with the library names for the three libraries.
Its another REST call. The ID will be in
outputs('Get_Group')?['body']?['d']?['id']
No worries. How did you get the Principle ID for your O365 group?
I haven't tried to do that. I believe there are some things available in Patterns and Practices that allow for that kind of site scripting. But that wouldn't be something specific to Power Automate, so this may not be the right place to get that question answered.
Do you know of a way to do this through a site script? It would be awesome to simply run a site script that creates all my libraries with the permissions on each that is needed.
You'll need to use HTTP REST calls for that. By default it should inherit the permissions for the site it is located in. To alter those you need to break inheritance and set the permission level for a particular individual or group. Its essentially the same REST calls as you would use on a folder or item, just at a different level. In the screenshot below principleID is the ID of the user/group and roleId is the ID of the permission level.
Michael E. Gernaey
179
Super User 2025 Season 1
David_MA
161
Super User 2025 Season 1
stampcoin
143