Graph API site permissions returning empty list

Rick Huang 66 Reputation points
2022-09-21T20:52:18.607+00:00

We created a new site and shared with some users, which added to the site's Members and Visitors sharepoint groups. However, when we query the sites permissions, we receive an empty array, with the right application permission (Sites.FullControl.All). https://learn.microsoft.com/en-us/graph/api/site-list-permissions?view=graph-rest-1.0&tabs=http

Endpoint hit: https://graph.microsoft.com/v1.0/sites/{site_id}/permissions

What exactly is the site permissions endpoint expected to return?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 6,086 Reputation points
    2022-09-22T02:51:20.873+00:00

    Hi @Rick Huang ,

    I tried to replicate this scenario but it is working as expected. To replicate this scenario I have created site permission using Create permission Graph API.
    243714-create.png

    After creating permission successfully, I was able to list permission in the response using this
    GET /sites/{sitesId}/permissions Graph API.
    243598-list.png

    Please Note : Site permission resource will not return 'site's Members and Visitors sharepoint groups'. It will return permissions granted to the Azure Apps which you can create as shown above.
    It does not return anything related to the good-old classic SharePoint permissions.

    For more details about Sites Permission please refer to this documentation.

    Hope this helps.

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

    3 people found this answer 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.