Apologize for delay in response.
I have tried this GET /sites/{siteId}/drive/items/{itemId}/permissions
Graph API and I am able to get roles in response. Please refer to below sample screenshot:
Please make sure you have created permission before trying to list the permission. You can create permission using this Graph API endpoint along with the request body by setting Roles property values.
Please refer to the sample request below:
POST https://graph.microsoft.com/v1.0/sites/{sitesId}/permissions
Content-Type: application/json
{
"roles": ["write"],
"grantedToIdentities": [{
"application": {
"id": "89ea5c94-7736-4e25-95ad-
"displayName": "Contoso Time Manager App"
}
}]
}
Refer to this documentation for more details.
As you have mentioned that "result shows all groups of the drive not only whose to which the user is assigned.", to get the specific permission you can use Get Site Permissions instead of List Site Permission.
Get Sites permission will help you to Retrieve the properties and relationships of a permission object on a site.
Use this GET https://graph.microsoft.com/v1.0/sites/{sitesId}/permissions/{permissionId}
Graph API endpoint for the same.
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.