Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WindowsIdentity::GetCurrent Method (TokenAccessLevels)

 

Returns a WindowsIdentity object that represents the current Windows user, using the specified desired token access level.

Namespace:   System.Security.Principal
Assembly:  mscorlib (in mscorlib.dll)

public:
[SecurityPermissionAttribute(SecurityAction::Demand, Flags = SecurityPermissionFlag::ControlPrincipal)]
static WindowsIdentity^ GetCurrent(
	TokenAccessLevels desiredAccess
)

Parameters

desiredAccess
Type: System.Security.Principal::TokenAccessLevels

A bitwise combination of the enumeration values.

Return Value

Type: System.Security.Principal::WindowsIdentity^

An object that represents the current user.

The desiredAccess parameter specifies an access mask that identifies the requested types of access to the access token. These requested access types are compared with the token's discretionary access control list (DACL) to determine which types of access are granted or denied.

SecurityPermission

for ability to manipulate the principal object. Associated enumeration: SecurityPermissionFlag::ControlPrincipal.

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft