ServiceAuthorizationBehavior.ServiceAuthorizationManager プロパティ

定義

サービス承認マネージャーを取得または設定します。

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

プロパティ値

サービス承認マネージャー。

次のコードは、カスタム サービス承認マネージャーを使用するようにこのプロパティを設定する方法を示しています。

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

注釈

ServiceAuthorizationManager クラスは、すべてのポリシーを評価し、前後にチェーンし、必要に応じて結果のAuthorizationContextServiceSecurityContextに接続し、アクセスを許可または拒否するtrueまたはfalseの承認決定を返します。

適用対象

こちらもご覧ください