ServiceAuthorizationBehavior.ServiceAuthorizationManager Vlastnost

Definice

Získá nebo nastaví správce autorizace služby.

public:
 property System::ServiceModel::ServiceAuthorizationManager ^ ServiceAuthorizationManager { System::ServiceModel::ServiceAuthorizationManager ^ get(); void set(System::ServiceModel::ServiceAuthorizationManager ^ value); };
public System.ServiceModel.ServiceAuthorizationManager ServiceAuthorizationManager { get; set; }
member this.ServiceAuthorizationManager : System.ServiceModel.ServiceAuthorizationManager with get, set
Public Property ServiceAuthorizationManager As ServiceAuthorizationManager

Hodnota vlastnosti

Správce autorizace služeb.

Příklady

Následující kód ukazuje, jak tuto vlastnost nastavit tak, aby používala vlastního správce autorizace služeb.

ServiceHost myServiceHost = new ServiceHost(typeof(Calculator), baseUri);
ServiceAuthorizationBehavior myServiceBehavior =
    myServiceHost.Description.Behaviors.Find<ServiceAuthorizationBehavior>();
myServiceBehavior.PrincipalPermissionMode =
    PrincipalPermissionMode.UseAspNetRoles;
MyServiceAuthorizationManager sm = new MyServiceAuthorizationManager();
myServiceBehavior.ServiceAuthorizationManager = sm;
Dim myServiceHost As New ServiceHost(GetType(Calculator), baseUri)
Dim myServiceBehavior As ServiceAuthorizationBehavior = myServiceHost.Description.Behaviors.Find(Of ServiceAuthorizationBehavior)()
myServiceBehavior.PrincipalPermissionMode = PrincipalPermissionMode.UseAspNetRoles
Dim sm As New MyServiceAuthorizationManager()
myServiceBehavior.ServiceAuthorizationManager = sm

Poznámky

Třída ServiceAuthorizationManager zodpovídá za vyhodnocení všech zásad, zřetězování dopředu a dozadu, případně připojení výsledku AuthorizationContextServiceSecurityContext k rozhodnutí true o autorizaci nebo false povolení nebo zamítnutí přístupu.

Platí pro

Viz také