cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MightyMen
Level: Powered On

A flow to change SharePoint Online Library permission

Hi,

 

Currently we have a tool that creates generic subsites (using a Sharepoint Online Site Template) on SharePoint Online with 5 libraries. Using the Template functionality in SharePoint online, libraries will have the same permissions on this subsite.

 

I want to make a flow (or another way to achieve this...?) that updates permissions on a created subsite. 

 

How I see this:

 

Trigger: when a site is created, of periodic lookup if there is a site created

Action: get libraries/lists

Action: get permissions

Action: Break permissions for specified library, and delete a usergroup from it

 

The Sharepoint default connector doesn't give me this options, so I have to work with the SharePoint Onlie API I gues.. Maybe someone has already made a flow like this or could help me... 🙂 

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
gsivasai
Level 8

Re: A flow to change SharePoint Online Library permission

Hi @MightyMen,

 

Yes you can and you are right in that it requires calling the SP Rest API endpoints. You will need to use the 'Send an Http Request to SharePoint' action to break permissions and remove role assignment for a SP group. Below is a snapshot of Flow actions showing how you can break permissions for a library, remove and add user groups.

 

f1.PNG

 

Note that the 'copyRoleAssignments' param is set to true" in the first action. This will enable inherting permissions from the site. Also, you need to find the SP group ids (getprincipalId & principalId) you want to remove or add to that library. You can find them by navigating to the user group via Site Settings -> People and Groups and then grab the 'MembershipGroupId' query string value from the url. The 'roledefId' specifies the type of permissions you want the SP group to have on that library. Check out this post for the different values you can use. Hope this helps!

 

View solution in original post

3 REPLIES 3
gsivasai
Level 8

Re: A flow to change SharePoint Online Library permission

Hi @MightyMen,

 

Yes you can and you are right in that it requires calling the SP Rest API endpoints. You will need to use the 'Send an Http Request to SharePoint' action to break permissions and remove role assignment for a SP group. Below is a snapshot of Flow actions showing how you can break permissions for a library, remove and add user groups.

 

f1.PNG

 

Note that the 'copyRoleAssignments' param is set to true" in the first action. This will enable inherting permissions from the site. Also, you need to find the SP group ids (getprincipalId & principalId) you want to remove or add to that library. You can find them by navigating to the user group via Site Settings -> People and Groups and then grab the 'MembershipGroupId' query string value from the url. The 'roledefId' specifies the type of permissions you want the SP group to have on that library. Check out this post for the different values you can use. Hope this helps!

 

View solution in original post

MightyMen
Level: Powered On

Re: A flow to change SharePoint Online Library permission

@AirlineDigital that's some real useful advice! I'm going to try it tomorrow! 

gsivasai
Level 8

Re: A flow to change SharePoint Online Library permission

@MightyMen Great! Glad it's helpful.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,296)