Adding Custom Permission Level in SharePoint

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")

Twitter This Tip! ReTweet this Tip!


Posted Jul 03 2012, 06:00 AM by sos

Comments

Adding Custom Permission Level in SharePoint – SharePoint Tips … | Mastering Sharepoint wrote Adding Custom Permission Level in SharePoint – SharePoint Tips … | Mastering Sharepoint
on 07-03-2012 12:51 PM

Pingback from  Adding Custom Permission Level in SharePoint – SharePoint Tips … | Mastering Sharepoint

Idera SharePoint Reviews SMBology, Inc. Rackspace Hosting Sponsored by Idera and SharePoint Reviews and SMBology and EPCGroup.net
Copyright 2011 SecretsOfSharePoint.com. All rights reserved.