Language

IAuthorizationPolicy.Evaluate(EvaluationContext, Object) Method

Definition

Evaluates whether a user meets the requirements for this authorization policy.

public:
 bool Evaluate(System::IdentityModel::Policy::EvaluationContext ^ evaluationContext, System::Object ^ % state);
public bool Evaluate(System.IdentityModel.Policy.EvaluationContext evaluationContext, ref object state);
abstract member Evaluate : System.IdentityModel.Policy.EvaluationContext * obj -> bool
Public Function Evaluate (evaluationContext As EvaluationContext, ByRef state As Object) As Boolean

Parameters

evaluationContext
EvaluationContext

An EvaluationContext that contains the claim set that the authorization policy evaluates.

state
Object

A Object, passed by reference that represents the custom state for this authorization policy.

Returns

false if the Evaluate(EvaluationContext, Object) method for this authorization policy must be called if additional claims are added by other authorization policies to evaluationContext; otherwise, true to state no additional evaluation is required by this authorization policy.

Remarks

Note

Implementers of the IAuthorizationPolicy interface should expect the Evaluate method to be called multiple times by different threads.

Implementers of the IAuthorizationPolicy interface can use the state parameter to track state between calls to the Evaluate method. If a state object is set inside a given call to the Evaluate method, the same object instance is passed to each and every subsequent call to the Evaluate method in the current evaluation process.

Applies to