cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jronash
Impactful Individual
Impactful Individual

Get list of SharePoint files with unique permissions

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

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



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

3 REPLIES 3
Expiscornovus
Super User
Super User

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



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Jronash
Impactful Individual
Impactful Individual

Thanks @Expiscornovus - this works great.

 

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

Expiscornovus
Super User
Super User

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



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,636)