Skip to content

Instantly share code, notes, and snippets.

@furkankaracan
Created April 4, 2024 14:25
Show Gist options
  • Save furkankaracan/5b690ed77cfd6ddbc9f1fdd89dd15e58 to your computer and use it in GitHub Desktop.
Save furkankaracan/5b690ed77cfd6ddbc9f1fdd89dd15e58 to your computer and use it in GitHub Desktop.
/// <summary>
/// Revokes access to a shared record.
/// </summary>
/// <param name="service">Authenticated client implementing the IOrganizationService interface</param>
/// <param name="principal">The user, team, or organization to revoke rights to the shared record.</param>
/// <param name="record">The shared record</param>
static void RevokeShare(
IOrganizationService service,
EntityReference principal,
EntityReference record)
{
RevokeAccessRequest request = new()
{
Revokee = principal,
Target = record
};
service.Execute(request);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment