You can create custom permission levels in SharePoint 2010 using Windows PowerShell. Start by creating a new object of the type Microsoft.SharePoint.SPRoleDefinition. Then, add a name and description and set the base permissions that you want to use:
PS > $spWeb = Get-SPWeb http://SP01.powershell.nu
PS > $perm = New-Object Microsoft.SharePoint.SPRoleDefinition
PS > $perm.Name = "Custom Permissions"
PS > $perm.Description = "Really Limited Access"
PS > $perm.BasePermissions = "ViewListItems, AddListItems”
PS > $spWeb.RoleDefinitions.Add($perm)
PS > $spWeb.Dispose()
If you want to check which base permissions are available, you can use System.Enum and the static method GetNames as shown below:
PS > [enum]::GetNames("Microsoft.SharePoint.SPBasePermissions")
ReTweet this Tip!
Posted
Jul 03 2012, 06:00 AM
by
sos