Hi @SunCrm
The documentation notes this:
The permissions relationship of DriveItem cannot be expanded as part of a call to get DriveItem or a collection of DriveItems. You must access the permissions property directly.
It seems that we are not currently able to extend the permissions of the driveitem collection. Calling the /permissions
API for each driveitem is the only way.
You can try using Graph SDK to get a collection of driveitems and iterate over the collection to get each sub-driveitem id and pass this id.
var subItems = await graphClient.Drives["{drive id}"].Items["{item id}"].Children.GetAsync();
foreach (var subItem in subItems.Value) {
var permissions = await graphClient.Drives["{drive id}"].Items[subItem.Id.ToString()].Permissions.GetAsync();
Console.WriteLine(permissions);
}
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.