title: How to change group permissions in sharepoint 2013 using C#
body: <p>I have a group "Visitors" with Contribute permission and I want to change permission to Read, programmatically. I don't have problem with adding new permission to the group, but I don't know how to remove old permission.</p>
  
  <p>How to change this code to remove permission Contribute and add permission Read?</p>
  
  <pre><code>SPWeb root = site.RootWeb;
  SPGroup group = root.SiteGroups["Visitors"];  
  SPRoleDefinition roleDefinition = root.RoleDefinitions.GetByType(SPRoleType.Reader);
  SPRoleAssignment roleAssignment = new SPRoleAssignment(group);
  roleAssignment.RoleDefinitionBindings.Add(roleDefinition);
  root.RoleAssignments.Add(roleAssignment);
  root.Update();
  </code></pre>