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)

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