ServiceAuthorizationBehavior.PrincipalPermissionMode Property

Gets or sets the principal permission mode.

Namespace: System.ServiceModel.Description
Assembly: System.ServiceModel (in system.servicemodel.dll)

public PrincipalPermissionMode PrincipalPermissionMode { get; set; }
/** @property */
public PrincipalPermissionMode get_PrincipalPermissionMode ()

/** @property */
public void set_PrincipalPermissionMode (PrincipalPermissionMode value)

public function get PrincipalPermissionMode () : PrincipalPermissionMode

public function set PrincipalPermissionMode (value : PrincipalPermissionMode)

Not applicable.

Property Value

The PrincipalPermissionMode.

This property contains one of the members of the PrincipalPermissionMode enumeration. Valid values are:

  • Custom. A custom IAuthorizationPolicy implementation is used to populate Thread.CurrentPrincipal.

  • None. The Thread.CurrentPrincipal property is not set.

  • UseAspNetRoles. The Thread.CurrentPrincipal property is set to an IPrincipal based on ASP.NET role information.

  • UseWindowsGroups. The Thread.CurrentPrincipal property is set to a WindowsPrincipal based on the user credentials of the incoming message.

This code shows how to set this property.

ServiceHost myServiceHost = new ServiceHost(typeof(Calculator), baseUri);
ServiceAuthorizationBehavior myServiceBehavior =
myServiceBehavior.PrincipalPermissionMode =

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0