How can I get permissions from SharePoint site using MS Graph

Adrian Corral Ruiz 20 Reputation points
2024-10-02T05:54:13.2166667+00:00

I am looking to see how I can get a list of SharePoint sites and then, get their permissions using the Graph API. I know that it could be done with SP Rest API, but I'm more interested in Graph.

I tried to get the permissions of one of my sites in my dev tenant, but I'm getting an empty array. I'll explain what I configured:

  • Azure App Registration with Graph -> Sites.FullControl.All api permission granted with admin consent. I have a secret created too. User's image
  • Then I made a POST request to get the Bearer token to get next steps User's image
  • Later, I made a GET request to get a list of sites in my tenant and worked successfully User's image
  • Finally, I'm trying requesting the permissions, but an empty array is returned: User's image

I tried to put only the id, the entire id, and more combinations, but this output is the same.

Any help would be appreciated!

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author
Xyza Xue_MSFT 30,336 Reputation points Microsoft External Staff
2024-10-02T07:26:50.6766667+00:00

Hi @Adrian Corral Ruiz ,

Thank you for posting in this community.

/sites/{sitesId}/permissions: Use this method to obtain application permissions; not site user permissions.

The default return value is an empty array, unless you have previously created permissions.

User's image

User's image

If you are trying to get Site Collection Permissions Report, there is no graph api for that, you can get it through powershell. If that's not your intention, forgive me for misunderstanding.


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

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

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