Condividi tramite


SPList.CheckPermissions Method

Checks whether the current user has the specified set of permissions for the list and throws an exception if the user does not have them.

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

Syntax

'Declaration
Public Overrides Sub CheckPermissions ( _
    permissionMask As SPBasePermissions _
)
'Usage
Dim instance As SPList
Dim permissionMask As SPBasePermissions

instance.CheckPermissions(permissionMask)
public override void CheckPermissions(
    SPBasePermissions permissionMask
)

Parameters

Implements

ISecurableObject.CheckPermissions(SPBasePermissions)

Exceptions

Exception Condition
UnauthorizedAccessException

The current user does not have the specified permissions.

Remarks

This method calls the base class CheckPermissions(SPBasePermissions) method to check the permissions.

You can catch the exception and redirect the user to /_layouts/AccessDenied.aspx.

See Also

Reference

SPList Class

SPList Members

Microsoft.SharePoint Namespace

DoesUserHavePermissions()