WindowsIdentity.GetCurrent Method (TokenAccessLevels)
.NET Framework (current version)
Returns a WindowsIdentity object that represents the current Windows user, using the specified desired token access level.
Assembly: mscorlib (in mscorlib.dll)
<SecurityPermissionAttribute(SecurityAction.Demand, Flags := SecurityPermissionFlag.ControlPrincipal)> Public Shared Function GetCurrent ( desiredAccess As TokenAccessLevels ) As WindowsIdentity
Parameters
- desiredAccess
-
Type:
System.Security.Principal.TokenAccessLevels
A bitwise combination of the enumeration values.
Return Value
Type: System.Security.Principal.WindowsIdentityAn 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
Available since 2.0
Show: