0

I have a SharePoint site that has many different Document Libraries. Each Document Library has unique permissions.

I can't seem to use the SharePoint REST API to get the email addresses of the users who have access to each Document Library. I tried /_api/lists/getbytitle()/RoleAssignments , but it gives me users who were assigned to other Document Libraries as well. For example, User Alice has been assigned to Document Library 1 , but not Document Library 2. When I do /_api/lists/getbytitle('Document Library 2')/RoleAssignments, somehow I have an entry for Alice as well, even though Alice has no permissions for Document Library 2.

I have a Java program that seeks to send email notification to all users who have access to a Document Library when certain specific changes happen to that particular Document Library.

1 Answer 1

0

The implementation really depends on how your security is set up. Do you have users added via Active Directory groups? Then you're going to need to query Active Directory to get those users. Good luck doing that in Java! Do you break inheritance anywhere? Things are going to get complicated. Do you have all your users explicitly added in a single SharePoint group? Piece of cake, just enumerate those users.

Personally I would push back on the requirement because it's too squishy. You can't reasonably obtain a list of every user who could possibly access a document. You're better off maintaining a list of those users and just iterating that to spam them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.