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?