Get Sharepoint library permissions

Rick Doll 21 Reputation points
2022-05-12T21:52:12.2+00:00

I am looking to see how I can get a list of all users, and groups, and users within groups, that have permissions to Libraries within Sharepoint.

I am trying to use MS Graph, but I am open to using the graph or the sharepoint rest api.

Any help would be appreciated!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,236 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,032 questions
{count} votes

Accepted answer
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more

3 additional answers

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,741 Reputation points Microsoft Vendor
    2022-05-13T14:37:40.15+00:00

    Hi @Rick Doll ,

    Currently using Graph API, you can either get site permission and get drive item permissions, fetching permissions for list or library is not supported. You can upvote this feature request for list permissions user voice.

    You can get subsite using GET /sites/domain.sharepoint.com:/{sitecoll}/{subsite}
    Get all lists from a subsite GET /sites/domain.sharepoint.com:/{sitecoll}/{subsite}:/lists,
    Drives GET /sites/domain.sharepoint.com:/{sitecoll}/{subsite}:/drives

    201825-847577-subsite-id.jpg

    Using SharePoint REST APIs you can get permissions for a site, list, library, item as well.

    https://domain.sharepoint.com/sites/{sitecoll}/{subsite}/_api/web/lists/GetByTitle('{listTitle}')/RoleAssignments?$expand=Member  
    

    Refrences:

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".


  2. David GROSPELIER 26 Reputation points
    2022-05-16T18:25:03.667+00:00

    We are using this API :
    https://graph.microsoft.com/v1.0/sites/<host>.sharepoint.com,<siteid>/lists/<listid>/items?expand=fields(select=id,Title)&select=id&$filter=fields/Modified ge '2022-04-15T09:29:37.3541196Z' (this operation in the doc: listitem-list).

    But we also tried to call this API https://graph.microsoft.com/v1.0/sites/<host>.sharepoint.com,<siteid>/permissions and we have an error telling that the operation is not supported... But it was working in the past (this operation in the doc: site-list-permissions).


  3. David GROSPELIER 26 Reputation points
    2022-05-19T06:18:20.883+00:00

    In fact, the API call was the right one, but there was an error in the Graph API after a recent deployment made by Microsoft, as explained in this post: the-34sitesselected34-permission-is-not-working-an.html

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.