RightsSensitiveVisibilityHelper.UserHasRights Method (PermissionContext, SPBasePermissions, PermissionMode, SPContext, SPWeb, 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, _
context As SPContext, _
contextWeb As SPWeb, _
contextList As SPList _
) As Boolean
'Usage
Dim permissionContext As PermissionContext
Dim permissions As SPBasePermissions
Dim permissionMode As PermissionMode
Dim context As SPContext
Dim contextWeb As SPWeb
Dim contextList As SPList
Dim returnValue As Boolean
returnValue = RightsSensitiveVisibilityHelper.UserHasRights(permissionContext, _
permissions, permissionMode, context, _
contextWeb, contextList)
public static bool UserHasRights(
PermissionContext permissionContext,
SPBasePermissions permissions,
PermissionMode permissionMode,
SPContext context,
SPWeb contextWeb,
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 SharePoint Foundation.
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.
context
Type: Microsoft.SharePoint.SPContextAn SPContext object that represents the context of an HTTP request.
contextWeb
Type: Microsoft.SharePoint.SPWebAn SPWeb object that represents a SharePoint site.
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