cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shanemeisnerdhg
Helper I
Helper I

Get SharePoint library permissions

I took this over from someone else so don't ask why they did it or the headache I have will be transferred to you 😉

 

We have a SharePoint site that has over 4,000 Client Document Libraries, most only have a couple documents.
All Libraries have Unique permissions.  

I need to get a list of who has Full control of each Document Libraries.

Once I get that, then I plan to move the documents to a different library and break the permissions on the individual files based on who had Full control in the current library.

 

I have started the flow to go to the site and get all Lists and Libraries. Then inside a Apply to each, I have a Send an HTTP request to SharePoint.

shanemeisnerdhg_0-1642175581068.png

 

The API: _api/web/lists/getByTitle('VarLibName')/RoleAssignments returns some data, but not the names that have access.

Once I get past this part and get all the documents moved with the correct permissions, I plan to build a Power app with two galleries.. One that shows them the client name that they have documents access, and then clicking on the client name will display the documents for that particular Client.

Any thoughts?

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @shanemeisnerdhg :

You can find the corresponding user according to the PrincipalId(GroupID) returned by 

_api/web/lists/getByTitle('VarLibName')/RoleAssignments

vbofengmsft_0-1642387623299.png

The Result:

vbofengmsft_1-1642387841803.png

Best Regards,

Bof

 

 

shanemeisnerdhg
Helper I
Helper I

@v-bofeng-msft  - Thanks for the help. unfortunately, that returns the Groups, but what I need are Individual Users.
Plus it returned some errors for me. example - It returned the group that has access to the Library:

shanemeisnerdhg_0-1642430567786.png

But then also errored out on what I can only assume is because it tried to lookup the user as a group:

shanemeisnerdhg_1-1642430750947.png

It seems just getting a list of who has access to a Library, and what permissions they have, isn't as easy as it should be.

I may have to revert to using ShareGate to create a report of all the libraries with permissions, store that as an excel file and use that to move the files to the new library with permissions.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,498)