Hi everyone,
I’m working on a C# application using the Microsoft Graph API version 4.51.0 to manage permissions in a SharePoint site’s document library Files. The code successfully sets permissions programmatically, we also getting destination permission id as response but the changes are not reflected when checking the permissions in the SharePoint UI.
Here’s the code I’m using to set the permissions:
IDriveItemInviteRequest permissionRequest = SelectedDrive.Items[DestinationDriveId] .Invite(destinationUserPermissions, true, destinationPermissionRoles, false, null) .Request(); IDriveItemInviteCollectionPage invites = MicrosoftHelper.InvokeApiCall(() => { return permissionRequest.PostAsync().Result; }, this);
-
SelectedDrive
and DestinationDriveId
are correctly initialized.
-
destinationUserPermissions
is a list of recipients (emails).
-
destinationPermissionRoles
contains roles like "write" or "read".
-
MicrosoftHelper.InvokeApiCall
is a helper to handle API calls and exceptions.
The issue: The API response indicates that permissions are being applied successfully (no errors or exceptions). However, when I check the SharePoint document library permissions in the UI, the changes are not visible.