web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Stop sharing permissio...
Power Automate
Unanswered

Stop sharing permission to a person for a SharePoint Library folder

(0) ShareShare
ReportReport
Posted on by 39

Hi all,

 

I'm trying to find a way to stop sharing permission to a person for a SharePoint Library folder using Power Automate. Apparently "Stop sharing an item or a folder" is gone and the results I get from Google searches are only for SharePoint lists. I'm still kind of new to the REST API, so is there any way I can remove permission using Automate?

Thanks 🙂

Categories:
I have the same question (0)
  • JohnAageAnderse Profile Picture
    1,986 on at

    Hello @jonw98 

     

    I am not sure what you see, but I see the action "Stop sharing an item or a file" which is the one I use for any revoking of access.

    Kind regards, John

  • jonw98 Profile Picture
    39 on at

    Hi @JohnAageAnderse,

    I'm trying to stop sharing for a folder, and I've tried using that action before and it does not work... 😞

    Not sure if I was doing something wrong or it just doesn't work for folders.

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @jonw98 

     

    Believe you have custom permissions set for document library folders. It is possible to remove specified user from a particular document library folder using SharePoint REST API. Please follow the below steps.

     

    Here I am using a manual trigger. First we need to find the user principal id. To find the id we need to know the user email address. Please see below.

     

    image.png

     

    Above JSON Schema is as follows:

     

    {
        "type""object",
        "properties": {
            "d": {
                "type""object",
                "properties": {
                    "__metadata": {
                        "type""object",
                        "properties": {
                            "id": {
                                "type""string"
                            },
                            "uri": {
                                "type""string"
                            },
                            "type": {
                                "type""string"
                            }
                        }
                    },
                    "Alerts": {
                        "type""object",
                        "properties": {
                            "__deferred": {
                                "type""object",
                                "properties": {
                                    "uri": {
                                        "type""string"
                                    }
                                }
                            }
                        }
                    },
                    "Groups": {
                        "type""object",
                        "properties": {
                            "__deferred": {
                                "type""object",
                                "properties": {
                                    "uri": {
                                        "type""string"
                                    }
                                }
                            }
                        }
                    },
                    "Id": {
                        "type""integer"
                    },
                    "IsHiddenInUI": {
                        "type""boolean"
                    },
                    "LoginName": {
                        "type""string"
                    },
                    "Title": {
                        "type""string"
                    },
                    "PrincipalType": {
                        "type""integer"
                    },
                    "Email": {
                        "type""string"
                    },
                    "Expiration": {
                        "type""string"
                    },
                    "IsEmailAuthenticationGuestUser": {
                        "type""boolean"
                    },
                    "IsShareByEmailGuestUser": {
                        "type""boolean"
                    },
                    "IsSiteAdmin": {
                        "type""boolean"
                    },
                    "UserId": {
                        "type""object",
                        "properties": {
                            "__metadata": {
                                "type""object",
                                "properties": {
                                    "type": {
                                        "type""string"
                                    }
                                }
                            },
                            "NameId": {
                                "type""string"
                            },
                            "NameIdIssuer": {
                                "type""string"
                            }
                        }
                    },
                    "UserPrincipalName": {
                        "type""string"
                    }
                }
            }
        }
    }
     
    Next steps are get the user principal id and execute the rest api method to remove the user permissions from a particular folder. Below 'TestAjDocLib' is my document library and 'A1' is my folder name. 
     
    image.png
     
    My Test Result:
     
    image.png
     
    If you have any questions please let me know.
     
    Thanks

     

     

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @jonw98 

     

    Do you need any further help in this?

     

    Thanks

  • Community Power Platform Member Profile Picture
    on at

    Hello, very helpful information!  I received a Bad Gateway on the http send DELETE method.  Any idea why?

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @caseyroot1 

     

    Could you please post another thread and explain a little bit about your problem you trying to solve? Also a screenshot is very helpful.

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard