RightsSensitiveVisibilityHelper.UserHasRights Method (PermissionContext, SPBasePermissions, PermissionMode, SPList)
Returns a Boolean value that indicates whether the current user has permissions for a specified SPList object.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Shared Function UserHasRights ( _
permissionContext As PermissionContext, _
permissions As SPBasePermissions, _
permissionMode As PermissionMode, _
contextList As SPList _
) As Boolean
'Usage
Dim permissionContext As PermissionContext
Dim permissions As SPBasePermissions
Dim permissionMode As PermissionMode
Dim contextList As SPList
Dim returnValue As Boolean
returnValue = RightsSensitiveVisibilityHelper.UserHasRights(permissionContext, _
permissions, permissionMode, contextList)
public static bool UserHasRights(
PermissionContext permissionContext,
SPBasePermissions permissions,
PermissionMode permissionMode,
SPList contextList
)
Parameters
permissionContext
Type: Microsoft.SharePoint.Utilities.PermissionContextvalue that indicates the context object to which a permission mask is applied.
permissions
Type: Microsoft.SharePoint.SPBasePermissionsAn SPBasePermissions value that specifies the built-in permissions available in
permissionMode
Type: Microsoft.SharePoint.Utilities.PermissionModeA PermissionMode value that specifies whether the user must have all of the rights specified in the permission mask to view a link, or only one of the rights specified in the permission mask.
contextList
Type: Microsoft.SharePoint.SPListThe SPList object to evaluate.
Return Value
Type: System.Boolean
true if the current user has permissions for the object; otherwise, false.
See Also
Reference
RightsSensitiveVisibilityHelper Class