Thread.CurrentPrincipal Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the thread's current principal (for role-based security).

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)

static member CurrentPrincipal : IPrincipal with get, set

Property Value

Type: System.Security.Principal.IPrincipal

An IPrincipal value representing the security context.

Exception Condition
SecurityException

The caller does not have the permission required to set the principal.

The following code example shows how to set and retrieve the principal of a thread.

No code example is currently available or this language may not be supported.

SecurityPermission

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

.NET Framework
Available since 1.1
Return to top
Show: