Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Es803TPMtTa516Ph2O5ztM
Power Automate - General Discussion
Answered

Get list of SharePoint files with unique permissions

Like (0) ShareShare
ReportReport
Posted on 22 Mar 2022 13:57:18 by 827

Hello all,

 

I'm looking for a way to get a list of files with unique permissions in a given SharePoint library.  The same list that you would see if you went to "Library Settings" > "Permissions for this document library" and then click on the banner that says "Some items of this list may have unique permissions which are not controlled from this page. Show these items."

 

Does anyone know of an API endpoint that would produce this list?

 

Thanks.

  • smorley Profile Picture
    544 on 10 Apr 2024 at 13:53:51
    Re: Get list of SharePoint files with unique permissions

    I don't want to step on anyone's toes, but SharePoint sees a folder as a document, so if you test it, and you give a folder unique permission it should show up.

  • dereinhera Profile Picture
    2 on 14 Mar 2024 at 14:45:38
    Re: Get list of SharePoint files with unique permissions

    Hi, great solution. How could I enhance it that it also show the users who have the unique permission and also show it for folders and not only files?

     

    Best regards

    Ralf 

  • DEAFWING Profile Picture
    3 on 08 Mar 2023 at 00:11:06
    Re: Get list of SharePoint files with unique permissions

    i was about to say the same thing - if you'v eworked on lists and libs for a while, it is common knowledge but it is documented in the api doc

  • Expiscornovus Profile Picture
    31,641 Most Valuable Professional on 29 Mar 2022 at 19:22:21
    Re: Get list of SharePoint files with unique permissions

    Hi @Jronash,

     

    I have worked with SharePoint since its 2003 version, so that probably helps 😜

     

    But joking aside, some old documentation is in these kind of situations still useful. Some concepts like securing objects is still pretty similar as in older versions, ISecurableObject.HasUniqueRoleAssignments Property

  • Jronash Profile Picture
    827 on 29 Mar 2022 at 18:58:59
    Re: Get list of SharePoint files with unique permissions

    Thanks @Expiscornovus - this works great.

     

    Out of curiosity, how did you know about the HasUniqueRoleAssignments attribute?  I'm always looking for good documentation.

  • Verified answer
    Expiscornovus Profile Picture
    31,641 Most Valuable Professional on 25 Mar 2022 at 22:27:29
    Re: Get list of SharePoint files with unique permissions

    Hi @Jronash,

     

    You could use the HasUniqueRoleAssignments property and filter on items which have a true value for that property.

     

    Below is an example.

    Btw, I tried to apply the filter directly in the REST API request, but that did not seem to work. That is why I used a filter array action afterwards.

     

    Uri value for the Send an HTTP request to SharePoint action.

    _api/web/lists/getbytitle('Documents')/items?$select=FileLeafRef,HasUniqueRoleAssignments

     

    Expression for From field in Filter Array:

    outputs('Send_an_HTTP_request_to_SharePoint')?['body']['value']

     

    In the criteria I use:

    item()['HasUniqueRoleAssignments']

    is equal to true

     

    hasuniqueroleassignments.png

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard