" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

How to programmatically create a custom permission level for a specific SharePoint site

Posted on November 23rd, 2015 by Chandrakant Jha

TheĀ  codeĀ  below shows how to programmatically create a custom permission level for a specific SharePoint site : using (SPSite osite = properties.Feature.Parent as SPSite) { using (SPWeb oweb = osite.OpenWeb()) { SPRoleDefinition roleDefinition = new SPRoleDefinition(); roleDefinition.Name = “Custom Permission Level”; roleDefinition.Description = “This Permission level has custom set of rights defined within it”; […]