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
permissionMask
Type: Microsoft.SharePoint.SPBasePermissionsA bitwise combination of enumeration values that specifies a set of permissions.
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.