cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PipManifold
Resolver I
Resolver I

Add user group permissions to a file in a sharepoint library - send an http request to sharepoint

Hi there,

I’m trying to add access to a user group using Flow.

I’m building a minutes repository and I’ve created a PowerApp which the different disciplines in our college can add the minutes to it using.

On the repository SharePoint I have created a user group for each discipline and I want Flow to give the correct group access. From my reading, you use a send HTTP request to Sharepoint to get the group and as it identifies using a string I’m getting PowerApps to look up the group name.

Then you initialize the variable using this function: body(‘Send_an_HTTP_request_to_-SharePoint’)[‘d’][‘id’]

Then you use a second Send an HTTP request to SharePoint but my flow is failing to add the user group.

I think it might be because my URI expression is for lists and I want to add permission to a file in a library.

Permissions cap.PNG

Any help would be greatly appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @PipManifold :
If you want to assigning permission for folder ,maybe you could try:

https://{site Url}/_api/web/GetFolderByServerRelativeUrl(‘Lists/{DocLibName }/{folder url}’)/ListItemAllFields/roleassignments/addroleassignment(principalid={User or group id},roleDefId={Role definition id})

I think this link may help you a lot:
SharePoint REST API URL for accessing List items,documents,assign permission in list, document libra... 

Best Regards,

Bof

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @PipManifold :
If you want to assigning permission for folder ,maybe you could try:

https://{site Url}/_api/web/GetFolderByServerRelativeUrl(‘Lists/{DocLibName }/{folder url}’)/ListItemAllFields/roleassignments/addroleassignment(principalid={User or group id},roleDefId={Role definition id})

I think this link may help you a lot:
SharePoint REST API URL for accessing List items,documents,assign permission in list, document libra... 

Best Regards,

Bof

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,197)