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 = "Desc Here";
roleDefinition.BasePermissions = SPBasePermissions.AddAndCustomizePages | SPBasePermissions.ApplyStyleSheets | SPBasePermissions.CreateGroups; oweb.RoleDefinitions.Add(roleDefinition);
}
}
{
using (SPWeb oweb = osite.OpenWeb())
{
SPRoleDefinition roleDefinition = new SPRoleDefinition();
roleDefinition.Name = "Custom Permission Level";
roleDefinition.Description = "Desc Here";
roleDefinition.BasePermissions = SPBasePermissions.AddAndCustomizePages | SPBasePermissions.ApplyStyleSheets | SPBasePermissions.CreateGroups; oweb.RoleDefinitions.Add(roleDefinition);
}
}
No comments:
Post a Comment