Compartilhar via


SPSite.DoesUserHavePermissions Method (SPReusableAcl, SPBasePermissions, SPWeb)

Returns a Boolean value that indicates whether the user has permissions for the specified Web site and set of rights.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)> _
Public Function DoesUserHavePermissions ( _
    acl As SPReusableAcl, _
    permissionMask As SPBasePermissions, _
    web As SPWeb _
) As Boolean
'Usage
Dim instance As SPSite
Dim acl As SPReusableAcl
Dim permissionMask As SPBasePermissions
Dim web As SPWeb
Dim returnValue As Boolean

returnValue = instance.DoesUserHavePermissions(acl, _
    permissionMask, web)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)]
public bool DoesUserHavePermissions(
    SPReusableAcl acl,
    SPBasePermissions permissionMask,
    SPWeb web
)

Parameters

Return Value

Type: System.Boolean
true if the user has permissions for the specified set of rights; otherwise, false. The permissions are checked against the reusable ACL, and the results do not depend on the specified SPWeb object. If you do not specify an SPWeb object, SharePoint Foundation uses the root Web site in the site collection. If you already initialized an SPWeb object, specifying it can improve performance because you do not need to initialize the root Web site.

See Also

Reference

SPSite Class

SPSite Members

DoesUserHavePermissions Overload

Microsoft.SharePoint Namespace