SPSecurableObject.CheckPermissions method

Determines whether the current user has a specified set of permissions.

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

Syntax

'Declaration
Public Overridable Sub CheckPermissions ( _
    permissionMask As SPBasePermissions _
)
'Usage
Dim instance As SPSecurableObject
Dim permissionMask As SPBasePermissions

instance.CheckPermissions(permissionMask)
public virtual 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 DoesUserHavePermissions method with permissionMask and throws the exception if DoesUserHavePermissions returns false.

See also

Reference

SPSecurableObject class

SPSecurableObject members

Microsoft.SharePoint namespace

DoesUserHavePermissions(SPBasePermissions)