I have run the csom code for break inheritance and set the unique permission on list item (ex.contribute). when user modified the list item, i want to the remove that unique permission and set other permission (ex.read).
if (listItem.HasUniqueRoleAssignments)
{
listItem.BreakRoleInheritance(false, false);
//istItem.ResetRoleInheritance();
context.ExecuteQuery();
}
if (!listItem.HasUniqueRoleAssignments)
{
listItem.BreakRoleInheritance(false, false);
context.ExecuteQuery();
}
Console.WriteLine("BreakRoleInheritance");