cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pedrogr90
Frequent Visitor

How can i remove individual or all permissions on a folder?

Hello, 

 

I am building a flow which would require to remove permission for an individual and assign it to a different person for a folder. 

 

What i tried was to use this : 

 

Screenshot 2020-07-21 at 16.50.35.png

But i get a "Folder is not supported"

 

After reading a lot, it seems that certainly the above just works for ListItems and Files. 

 

Another alternative I thought was to use the REST API: _api/lists/getByTitle('Documents')/items('item')/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)

 

The above simply breaks the inheritance which can result in deleting some permssions if these are not part of the parent, but it's not a valid workaround. 

 

My question is if there is any way to remove individual , or all if necessary, permission on a folder via REST API maybe?

 

Thanks

Pedro

2 REPLIES 2
manuelstgomes
Super User II
Super User II

Hi @Pedrogr90 

 

The above should work. Can you please share a little bit more of your Flow so that I can try to help you.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

darsoohoo
Regular Visitor

Hi @Pedrogr90 ,


Have you figured this out? After you break the inheritance, to remove an individuals permissions from a folder/item, you can send another HTTP request to remove the user. Here are the steps from beginning to end.


STEP 1. Send an HTTP request to break inheritance.

_api/lists/getByTitle('ListName')/items(itemID)/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)

Example:

Screen Shot 2020-12-08 at 11.01.27 AM.png

 

STEP 2. Get the principle id of the user you want to remove and set it to a variable.

createdby-principleid.png

 

STEP 3. Send an HTTP request to remove the user from item

_api/lists/getByTitle('ListName')/items(itemID)/roleassignments/removeroleassignment(principalid=CreatedByPrincipleID)

Example:

Screen Shot 2020-12-08 at 10.51.51 AM.png

 

Hope this helps!

Darren

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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (20,394)