Question

I managed to use Power Automate to create SP groups and add users to them using the HTTP request action.

The problem I have is the newly created groups are created at the "root" (in People and Groups section) level but not in the site in the "Site Permissions" section so user that i add to the group still do not have access to the site.

I created a flow that adds the group(s) to "site Pages" , "Site assets" and to the specific libraries but they don't have access to the site itself since the groups are not in "Site Permissions".

Does anyone know how to add a newly created group to "Site Permissions"?

Was it helpful?

Solution

After creating a SharePoint group, you need to assign the permissions to it at site (web) level.

Add a new action 'Send HTTP request to SharePoint' and configure the action to use endpoint as below:

/_api/web/roleassignments/addroleassignment(principalid=<GROUPID>, roledefid=1073741827)

roledefid is for Permission Levels which are as follows:

1073741829 - Full Control

073741827 - Contribute

1073741826 - Read

<GroupID> is the id of the group.

Reference: SharePoint Group Operations in Microsoft Flow

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top