ServiceAuthorizationBehavior.PrincipalPermissionMode Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the principal permission mode.
public:
property System::ServiceModel::Description::PrincipalPermissionMode PrincipalPermissionMode { System::ServiceModel::Description::PrincipalPermissionMode get(); void set(System::ServiceModel::Description::PrincipalPermissionMode value); };
public System.ServiceModel.Description.PrincipalPermissionMode PrincipalPermissionMode { get; set; }
member this.PrincipalPermissionMode : System.ServiceModel.Description.PrincipalPermissionMode with get, set
Public Property PrincipalPermissionMode As PrincipalPermissionMode
Property Value
The principal permission mode.
Examples
This code shows how to set this property.
ServiceHost myServiceHost = new ServiceHost(typeof(Calculator), baseUri);
ServiceAuthorizationBehavior myServiceBehavior =
myServiceHost.Description.Behaviors.Find<ServiceAuthorizationBehavior>();
myServiceBehavior.PrincipalPermissionMode =
PrincipalPermissionMode.UseAspNetRoles;
Dim myServiceBehavior As ServiceAuthorizationBehavior
myServiceBehavior = _
myServiceHost.Description.Behaviors.Find(Of ServiceAuthorizationBehavior)()
myServiceBehavior.PrincipalPermissionMode = _
PrincipalPermissionMode.UseAspNetRoles
Remarks
This property contains one of the members of the PrincipalPermissionMode enumeration. Valid values are:
Custom. A custom
IAuthorizationPolicy
implementation is used to populateThread.CurrentPrincipal
.None. The
Thread.CurrentPrincipal
property is not set.UseAspNetRoles. The
Thread.CurrentPrincipal
property is set to anIPrincipal
based on ASP.NET role information.UseWindowsGroups. The
Thread.CurrentPrincipal
property is set to aWindowsPrincipal
based on the user credentials of the incoming message.