cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ccoxck
Regular Visitor

Set SharePoint Library Permissions

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. 

ccoxck_0-1641396082357.png

 

5 REPLIES 5
Pstork1
Dual Super User
Dual Super User

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.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
ccoxck
Regular Visitor

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.

Pstork1
Dual Super User
Dual Super User

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
ccoxck
Regular Visitor

No worries. How did you get the Principle ID for your O365 group? 

Pstork1
Dual Super User
Dual Super User

Its another REST call.  The ID will be in 

outputs('Get_Group')?['body']?['d']?['id']

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,515)