共用方式為


SPSecurableObject.CheckPermissions Method

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

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

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)