This documentation is archived and is not being maintained.

SPWeb.DoesUserHavePermissions Method (String, SPBasePermissions)

Windows SharePoint Services 3

Checks permissions of the specified user for a specified set of rights and returns a Boolean value.

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

public bool DoesUserHavePermissions(
	string login,
	SPBasePermissions permissionMask


Type: System.String
A string that contains the user name (DOMAIN\User_Alias) of a Web site user.
Type: Microsoft.SharePoint.SPBasePermissions
An SPBasePermissions value that specifies the rights.

Return Value

Type: System.Boolean
true if the user has the specified rights; otherwise, false.

The current user must have EnumeratePermissions rights to check the permissions of other users.