Partilhar via


SPWeb.GetUserToken Method

Retrieves the user token for the specified user.

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

Syntax

'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)> _
Public Function GetUserToken ( _
    userName As String _
) As SPUserToken
'Usage
Dim instance As SPWeb
Dim userName As String
Dim returnValue As SPUserToken

returnValue = instance.GetUserToken(userName)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)]
public SPUserToken GetUserToken(
    string userName
)

Parameters

Return Value

Type: Microsoft.SharePoint.SPUserToken
The token for the specified user.

Remarks

The current user must have SPBasePermissions.EnumeratePermissions.

See Also

Reference

SPWeb Class

SPWeb Members

Microsoft.SharePoint Namespace

SPBasePermissions