Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 8OzepfGL8FUEflo7B+4WLX
Power Automate - Building Flows
Unanswered

Set SharePoint Library Permissions

Like (0) ShareShare
ReportReport
Posted on 5 Jan 2022 15:21:49 by 4

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

 

  • Pstork1 Profile Picture
    66,281 Most Valuable Professional on 28 Sep 2022 at 20:37:21
    Re: Set SharePoint Library Permissions

    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.

  • kmw1130 Profile Picture
    948 on 28 Sep 2022 at 15:22:25
    Re: Set SharePoint Library Permissions

    @Pstork1 @ccoxck I am doing something very similar to this.  I've created a flow from a SP List that then creates a site from a template and inherits permissions from the parent, but then I need to have 3 libraries within that newly created site to have unique permissions.  

  • Pstork1 Profile Picture
    66,281 Most Valuable Professional on 05 Jan 2022 at 17:31:12
    Re: Set SharePoint Library Permissions

    Its another REST call.  The ID will be in 

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

    image.png

  • ccoxck Profile Picture
    4 on 05 Jan 2022 at 16:50:56
    Re: Set SharePoint Library Permissions

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

  • Pstork1 Profile Picture
    66,281 Most Valuable Professional on 05 Jan 2022 at 16:49:02
    Re: Set SharePoint Library Permissions

    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.

  • ccoxck Profile Picture
    4 on 05 Jan 2022 at 15:47:56
    Re: Set SharePoint Library Permissions

    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 Profile Picture
    66,281 Most Valuable Professional on 05 Jan 2022 at 15:29:54
    Re: Set SharePoint Library Permissions

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 179 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 161 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 143

Overall leaderboard
Loading started
Loading complete