Hi @Ankur Gupta
Call the GET /drives/{drive-id}/items/{item-id}/permissions
endpoint directly with your calling user, then check the returned JSON response, if the roles
property contains write/read, then check the grantedToV2
property to see if it contains the current calling user.
{
"value": [
{
"id": "permission-id",
"roles": ["read"],
"grantedToV2": {
"user": {
"id": "user-id",
"displayName": "User Name"
}
}
},
{
"id": "permission-id",
"roles": ["write"],
"grantedToV2": {
"user": {
"id": "user-id",
"displayName": "User Name"
}
}
}
]
}
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.