-
Hi, I'm attempting to use the Demo.PersistentTokenCache sample to update both the Created and Modified properties of a single file. For some reason both Created and Modified don't get updated when UpdateOverwriteVersionAsync is ran. Instead, it just updates the Modified property with the time the update is executed. If I run this code with the InteractiveAuthenticationProvider it works correctly. Scope's set: Sites.Manage.All (Graph) Here's my file update code: var doc = await context.Web.Lists.GetByTitleAsync("Documents", p => p.Fields);
var file = doc.RootFolder.Files.Where(x => x.Name == "testing123.txt").FirstOrDefault();
await file.LoadAsync(p => p.ListItemAllFields);
var newDate = new DateTime(2020, 10, 20);
file.ListItemAllFields["Created"] = newDate;
file.ListItemAllFields["Modified"] = newDate;
await file.ListItemAllFields.UpdateOverwriteVersionAsync(); Any idea's why this might be happening? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
So not long after posting this I've got it working. It required me to change the SharePoint AllSites.Manage (Delegated) scope to SharePoint AllSites.FullControl (Delegated). Little confused on why AllSites.Manage doesn't work for PersistentTokenCache but it works fine with InteractiveAuthenticationProvider? |
Beta Was this translation helpful? Give feedback.
So not long after posting this I've got it working. It required me to change the SharePoint AllSites.Manage (Delegated) scope to SharePoint AllSites.FullControl (Delegated). Little confused on why AllSites.Manage doesn't work for PersistentTokenCache but it works fine with InteractiveAuthenticationProvider?