Bagikan melalui


ServiceAuthorizationBehavior.PrincipalPermissionMode Properti

Definisi

Mendapatkan atau mengatur mode izin utama.

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

Nilai Properti

Mode izin utama.

Contoh

Kode ini menunjukkan cara mengatur properti ini.

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

Keterangan

Properti ini berisi salah satu anggota PrincipalPermissionMode enumerasi. Nilai yang valid adalah:

  • Custom. Implementasi kustom IAuthorizationPolicy digunakan untuk mengisi Thread.CurrentPrincipal.

  • None. Properti Thread.CurrentPrincipal tidak diatur.

  • UseAspNetRoles. Properti Thread.CurrentPrincipal diatur ke IPrincipal berdasarkan informasi peran ASP.NET.

  • UseWindowsGroups. Properti Thread.CurrentPrincipal diatur ke WindowsPrincipal berdasarkan kredensial pengguna dari pesan masuk.

Berlaku untuk

Lihat juga