I am handling SharePoint granular permission using the sites.Selected the scope option and granted the application access/role via graph API permission. It is working fine, If the app needs to work with all the available Lists/Drives with the site.
For ex. https://graph.microsoft.com/v1.0/sites/{site-Id}/Permissions
and passing the below payload.
{
"roles": [
"write"
],
"grantedToIdentitiesV2": [
{
"application": {
"id": << App Id >>
"displayName": "TestDaemonGraphAPI"
}
}
]
}
However, I have a couple of drive/document libraries where the access needs to be restricted for the App. Since I am setting permission at the site level, it allows access to all the drives.
How can we allow access at only Drive/library level using graph api?
Update: I've tried granting permission at the Drive level, it was failing. Error Detail