Partager via


DefaultAuthorizationHandlerContextFactory.CreateContext Méthode

Définition

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

public:
 virtual Microsoft::AspNetCore::Authorization::AuthorizationHandlerContext ^ CreateContext(System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource);
public virtual Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext CreateContext (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements, System.Security.Claims.ClaimsPrincipal user, object resource);
public virtual 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
override this.CreateContext : seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> * System.Security.Claims.ClaimsPrincipal * obj -> Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext
Public Overridable Function CreateContext (requirements As IEnumerable(Of IAuthorizationRequirement), user As ClaimsPrincipal, resource As Object) As AuthorizationHandlerContext

Paramètres

requirements
IEnumerable<IAuthorizationRequirement>

Exigences à évaluer.

user
ClaimsPrincipal

Utilisateur par rapport à 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 la stratégie, vous pouvez passer null comme valeur.

Retours

L’AuthorizationHandlerContextopérateur

Implémente

S’applique à