Identifying the correct group from permissions object when multiple groups with same name exists.

Rency Joseph 6 Reputation points
2021-01-08T20:19:18.957+00:00

We access the permission information for SharePoint files using GET /drives/{drive-id}/items/{item-id}/permissions API. Since SharePoint allows 2 groups with the exact same name e.g. Data (1 with email id "data@Anonymous .com" and other with "data1@Anonymous .com") the site groups in permissions (Data Owners, Data Visitors, and Data Members) have the exact same display names and no other information like email/id.
"grantedTo": {
"user": {
"displayName": "Data Owners"
}
},
"grantedTo": {
"user": {
"displayName": "Data Visitors"
}
}
"grantedTo": {
"user": {
"displayName": "Data Members"
}
}

This is the same for both the Data groups, the only difference being the final Data Owners blob which gives the email id of the group it is really associated with as shown below.
"grantedTo": {
"user": {
"email": "data1@Anonymous .com",
"displayName": "Data Owners"
}
}
Q1. Is there any way we could get more information on the site groups in the permissions in this / any other Graph API? We checked the other Graph APIs for permissions available-
GET /groups/{group-id}/drive/items/{item-id}/permissions
GET /me/drive/items/{item-id}/permissions
GET /me/drive/root:/{path}:/permissions
GET /sites/{siteId}/drive/items/{itemId}/permissions
GET /users/{userId}/drive/items/{itemId}/permissions
and all of them give similar information as shown above.

Q2. We edited the email id for the 2nd Data group from data1@Anonymous .com to data123@Anonymous .com. Now, we get data123@Anonymous .com when we pull in the group information but get data1@Anonymous .com in the permissions. Is there any way we could connect the 2 email ids since the group id is also not present in the permissions?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,515 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Stijn Tratsaert 1 Reputation point
    2021-10-15T08:43:07.243+00:00

    Hi,

    I am struggling to get this right as well. Did you manage to solve this and if that is the case may ask how?
    It is an important objective for us to parse these permissions correctly and the current implementation that is given in the graph API is quite... vague.

    Thanks in advance!

    0 comments No comments