Partager via


IAuthorizationHandlerContextFactory.CreateContext Méthode

Définition

Crée un AuthorizationHandlerContext utilisé pour l’autorisation.

public:
 Microsoft::AspNetCore::Authorization::AuthorizationHandlerContext ^ CreateContext(System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource);
public Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext CreateContext (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements, System.Security.Claims.ClaimsPrincipal user, object resource);
public Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext CreateContext (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements, System.Security.Claims.ClaimsPrincipal user, object? resource);
abstract member CreateContext : seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> * System.Security.Claims.ClaimsPrincipal * obj -> Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext
Public Function CreateContext (requirements As IEnumerable(Of IAuthorizationRequirement), user As ClaimsPrincipal, resource As Object) As AuthorizationHandlerContext

Paramètres

requirements
IEnumerable<IAuthorizationRequirement>

Conditions requises à évaluer.

user
ClaimsPrincipal

Utilisateur sur lequel évaluer les exigences.

resource
Object

Ressource facultative avec laquelle la stratégie doit être vérifiée. Si une ressource n’est pas requise pour l’évaluation de stratégie, vous pouvez passer null comme valeur.

Retours

L’AuthorizationHandlerContextopérateur

S’applique à