amritanshu
amritanshu

Reputation: 797

How to detect change in permissions for an Item in OneDrive?

I was trying out the graph APIs and was looking at /delta call, I was not able to use it to identify if a permission for an item had changed?

Is there a smart way to do it?

I am referring to these permissions, I can modify them through SharePoint site or using the ms graph API endpoints. Based on my understanding sharing also involves modifications to them and is just one of the usecase.

Upvotes: 0

Views: 350

Answers (1)

Kashif Tahir
Kashif Tahir

Reputation: 311

With the existing Graph APIs, there is no straight forward way of tracking permission changes(or any other change for that matter). The delta API should tell you that something has changed for an item and that your app needs to sync it. Here are the steps you can try:

  • Create an item in the drive (document library).
  • Call delta api and note the value of odata.deltaLink.
  • Share the item with someone(or remove permissions from the item).
  • Call delta api again using the deltaLink value you saved earlier.

The response will contain the item whose permissions were modified after the first call to delta api. Unless your app persisted item permissions, and then compared the permissions before and after the item was synced, there is no good answer at this point.

Upvotes: 1

Related Questions