Hi,
i am trying to remove/stop the inheritance permission from folder for a specific group as soon as created into document library. i am assuming first i need to break the inheritance and then remove that specific group permission from folder. could you please help me with steps?
Thanks in advanced
i was trying to use below steps but not working. any idea what i need to change so it will break inheritance as well remove permission for specific group.
Solved! Go to Solution.
To achieve this you will have to follow below steps
_api/web/GetFolderByServerRelativeUrl('Shared%20Documents/Test')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)
_api/web/GetFolderByServerRelativeUrl('Shared%20Documents/Test')/ListItemAllFields/RoleAssignments/groups/RemoveByLoginName('Name of the Sharepoint Group')
Please remember while sending API requests, you need to specify the Name that appears in the URL for Libraries/Lists when you access them
Hope this helps!
To achieve this you will have to follow below steps
_api/web/GetFolderByServerRelativeUrl('Shared%20Documents/Test')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)
_api/web/GetFolderByServerRelativeUrl('Shared%20Documents/Test')/ListItemAllFields/RoleAssignments/groups/RemoveByLoginName('Name of the Sharepoint Group')
Please remember while sending API requests, you need to specify the Name that appears in the URL for Libraries/Lists when you access them
Hope this helps!
Hello NiloferA,
Thanks for your reply. i have another question related to this thread. as this flow only will remove newly created folder permission but how about existing folder permission. will that specific group permission will remove from all newly created folder as well existing folder? i think answer is No, because we started with action "When a file is created ". what i need to change with the flow to make it happen?
Thanks again
If you want to Break Permissions for all the Folders in the library, you can do something like this, but then you have to think when does this Flow need to be triggered. I am triggering this Flow manually on a button click.
From: outputs('Send_an_HTTP_request_to_SharePoint_3')?['body']['d']['results']
Map section - key: Name; value: item()?['Name']
Hope this should clarify your question.
Just one thing to remember, the Remove Group Permissions will give you an error if the Group Permissions have already been removed. So you will have to add a condition to see whether the Group has access on the Folder or not, if yes only then remove the permissions for this group. Let me know if you need help here as well.
Hello,
appreciated for your help. actually my scenario is i have already library with many folders and subfolders and has removed that specific group from library level. Now i need to reassign read permission for this specific group at library level then i am assuming it will inherit that group again to all folders and sub-folders. if that is the case then i need to remove that group only from all existing and newly created folders going forward. Based on my scenario, do you think above solution will work? Basically we need some mechanism that will check each and every folder for that specific group and if find just remove it. but group should still remain in the library level.
Hello NilferA,
i am receiving the below error. any idea please
Hello @rakib1,
I understand your scenario, please find below my answers to your questions
Please Post a Reply if there are further questions.
Hello NiloferA,
its seems to me working but getting error though like below screen shot. any idea please?
If you see the error, it says that you are trying to remove the permissions for "Forms" folder which is a hidden folder and this action is not allowed. Please try removing this folder from your array of folder names and try again.
If you need help how to remove items from the array, you can check it in my reply above or refer this post here https://powerusers.microsoft.com/t5/Building-Flows/Skip-Array-Indexes/td-p/482993
Trying to implement this solution to skip the system folder "Forms", however it is not the first item returned like in the example above it is the 3rd item. My library has 4 items and if I use skip(body('Select'),3) it will only return the 4th item. So what would the expression be to return items 1, 2, & 4?
This solution works for SharePoint security groups, but it does not work removing Office 365 Groups/domain groups. Do have the api to handle O365 groups? Do I need to use a different Send an Http action?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
50 | |
18 | |
15 | |
12 | |
12 |
User | Count |
---|---|
60 | |
41 | |
24 | |
20 | |
19 |