Add or Remove permission level to SharePoint group or user programmatically.

[code lang=”c”] Below code describes how to add/remove permission level to user programmatically using client object model. class Program { static void Main(string[] args) { using (ClientContext ctx = new ClientContext(“http://siteUrl”)) { NetworkCredential netCredentials = new NetworkCredential(“userName”, “password”); ctx.Credentials = netCredentials; try { Web web = null; web = ctx.Web; RoleAssignmentCollection assignColl; RoleAssignment roleAssign; string userOrGroup = “Administrator”; //we can […]