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

Stop sharing from folders using power automate

Hi,

i am trying to build a flow so that it will automatically remove/stop sharing inherited group permission from all folders as soon as it created. could you please provide the steps to achieve that? For some reason, i dont see "stop sharing an item or a folder" action but i do have action on the list "stop sharing an item or file". using this action was able to remove the permission from file/items level but not folder level.

Thanks in advanced!

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @rakib1 

I did a test on my side and it is working:

isFolder2.png

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

9 REPLIES 9
fchopo
Super User II
Super User II

Hello @rakib1 

You can break folder inheritance using the "Send an HTTP request to SharePoint" action:

sharepointHttp.png

 You should use a POST method, and use the following Uri:

_api/Web/GetFolderByServerRelativeUrl('documentlibraryname/foldername')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=false, clearSubscopes=true)

Where you have to replace "documentlibraryname" and "foldername" by your values ("Shared Documents/Samples" in my example).

Hope it helps!

Ferran

 

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
rakib1
Frequent Visitor

Hello Ferran,

Thanks for your reply. i have tried with "Send an HTTP request to SharePoint" action but it did n't work for me. is there anyway we could get folders dynamically as soon they created. Because my requirement is when users will create new folders just stop the inheritance permission for certain group. As i said, its working for me at files/items level when using "Stop sharing an item or file" action but not at folder level. Again looking some automated solution where as soon new folders will create in library just stop the sharing for specific group which will inherited from library.

 

Capture.JPG

Hello @rakib1 

I did a test on my side and it is working:

isFolder2.png

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

rakib1
Frequent Visitor

Hello Ferran,

Appreciated for your hard work on this. i have tried to replicated the solution like you but for some reason its not working, if i go to manage access from folder still i can see permissions are inheriting from library to folder. no idea what i am doing wrong? any light on this please.

 

Capture.JPG

 

fchopo
Super User II
Super User II

Hello @rakib1 

If your screenshot is right, you forget to add "true" in the condition (isFolder is equal to true).

truecondition.png

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
rakib1
Frequent Visitor

Thanks Again Ferran. its working like a charm. is there any condition we can put in the flow so that it will stop sharing for all except full control permission from library?

 

Hello @rakib1 

I don't understand your requirement. Do you mean by leaving the permissions to the owners? In any case you could use the "grant access to an item or folder" SharePoint action to grant permissions to a user or group.

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
rakib1
Frequent Visitor

Hello Ferran,

sorry for not explaining in details. all i am saying right now its deleting all the groups or users except owners which is inheriting from library. Lets say i have one group called "Madona" which has full control permission at library level. so when i will create new folders, oviously it will inherit all groups and users from library and will delete by flow but i dont want to delete "Madona" group by flow which has full control. could we do that please?

Hi, thanks for your reply. But one question, how I can input the Uri in Send a HTTP request... 

Need me input it manually ?

 

Dengjinyu_1-1621477003464.png

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,212)