cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerUser0
Helper II
Helper II

Flow to change the permission from contribute to read-only

Hi All,

 

I have requirement to design a flow which will change the permissions of all the security groups present inside the folder to read/view only.

Currently I have a folder "A" which has 3 security groups :

Security group 1---Full control

Security group 2---Contribute

Security group 3---Contribute

Now I want to create a flow which will change these 3 permissions to View only

Security group 1---Read

Security group 2---Read

Security group 3---Read

 

Please help!!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Resident Rockstar
Resident Rockstar

@PowerUser0 this end point will give you all principal ids of groups and users

 

_api/lists/getByTitle('DISPLAYNAME)/items(ITEMID)/roleassignments

Example

_api/lists/getByTitle('Documents')/items(42)/roleassignments

 

Get group name and pass it to change permission action

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

6 REPLIES 6
jinivthakkar
Resident Rockstar
Resident Rockstar

@PowerUser0 you can use "Grant access to an item or a folder" action and do this. Check this out 

 

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Power-Automate-and-SharePoint-Perm...

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Hi @jinivthakkar ,

 

No its not working I tried that.

 

Hi @jinivthakkar 

 

This is not working for me because I do not know the the names of security groups so I can not enter anything in recipient column, I want that flow should find out what all security groups are present in the folder and change there permission level to View only

jinivthakkar
Resident Rockstar
Resident Rockstar

@PowerUser0 this end point will give you all principal ids of groups and users

 

_api/lists/getByTitle('DISPLAYNAME)/items(ITEMID)/roleassignments

Example

_api/lists/getByTitle('Documents')/items(42)/roleassignments

 

Get group name and pass it to change permission action

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

jinivthakkar
Resident Rockstar
Resident Rockstar

@PowerUser0 break inheritance and assign read permissions, no need to get group name

jinivthakkar_0-1623417771213.png

 

https://powerusers.microsoft.com/t5/Building-Flows/Folder-Permissions/m-p/880255

 

Full Control------1073741829

Design-----------1073741828

Edit---------------1073741830

Contribute-------1073741827

Read-------------1073741826

View Only--------1073741924

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

Hi @jinivthakkar 

Thanks for your help! it works for me!

But I also used Parse json which will filter out the principle id's of all the security groups.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,099)