Share via


SPRole.PermissionMask property

NOTE: This API is now obsolete.

Use the new SPRoleDefinition and SPRoleAssignment classes instead, to define roles and to assign users to them. For more information, see Authorization object model. (In Windows SharePoint Services 2.0, the PermissionMask property returned or set the permission mask for the role is maintained for backward compatibility.)

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
<ObsoleteAttribute("Use the SPRoleDefinition class instead")> _
Public Property PermissionMask As SPRights
    Get
    Set
'Usage
Dim instance As SPRole
Dim value As SPRights

value = instance.PermissionMask

instance.PermissionMask = value
[ObsoleteAttribute("Use the SPRoleDefinition class instead")]
public SPRights PermissionMask { get; set; }

Property value

Type: Microsoft.SharePoint.SPRights
An SPRights value that specifies rights for the permission mask.

Remarks

To define a permission mask for a role that consists of multiple rights, use the pipe symbol ("|") in Microsoft Visual C# or Or in Microsoft Visual Basic to delimit the rights.

Examples

The following code example modifies the permission mask for a specified role.

Dim site As SPWeb = SPContext.Current.Web
Dim role As SPRole = site.Roles("Role_Name")

role.PermissionMask = SPRights.ManageLists Or 
    SPRights.ManageListPermissions
SPWeb oWebsite = SPContext.Current.Web;
SPRole oRole = oWebsite.Roles["Role_Name"];
oRole.PermissionMask = SPRights.ManageLists | 
    SPRights.ManageListPermissions;

See also

Reference

SPRole class

SPRole members

Microsoft.SharePoint namespace