Why am I only getting sharepoint groups when requesting a DriveObject's permissions

Adam 41 Reputation points
2022-04-28T18:29:08.5+00:00

I am calling /drives/<drive-id>/items/<item-id>?expand=listItem,permissions and am only getting sharepoint groups listed in the file's permissions. There are microsoft 365 groups assigned to the sharepoint site and I have seen the corresponding 365 group listed in this very permissions list before, but it seems to have disappeared.

The scope of the access token I am using is:
User.ReadBasic.All+Group.Read.All+Directory.AccessAsUser.All+Files.Read+Files.Read.All+Sites.Read.All+offline_access

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,620 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.
2,673 questions
0 comments No comments
{count} votes

Accepted answer
  1. JanardhanaVedham-MSFT 3,536 Reputation points
    2022-04-29T07:02:13.26+00:00

    Hi @Anonymous ,

    I have verified the below Microsoft Graph API end points and both returns permissions object/resource in API response.

    GET /drives/{drive-id}/items/{item-id}?expand=listItem,permissions
    GET /drives/{drive-id}/items/{item-id}/permissions

    However as mentioned in this permissions resource documentation, grantedTo property will return IdentitySet and the IdentitySet resource and it's supported properties are application,device and user. M365 Group is no more supported property of IdentitySet and hence you might be seeing the difference in response.

    197598-image.png

    Please note the below 2 important points on permissions resource type :

    1. As mentioned here, grantedTo and grantedToIdentities will be deprecated going forward and the response will be migrated to grantedToV2 and grantedToIdentitiesV2 respectively under appropriate property names.

    197672-image.png

    2.As mentioned here, grantedToV2 propery will return SharePointIdentitySet resource and currently it supports siteUser (i.e,SharePoint user) and siteGroup (i.e., SharePoint group) properies. It does not support or return M365 group property.

    197606-image.png

    Hope this helps.

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

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful