Sdílet prostřednictvím


IAuthorizationHandlerContextFactory.CreateContext Metoda

Definice

Vytvoří použitou AuthorizationHandlerContext k autorizaci.

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

Parametry

requirements
IEnumerable<IAuthorizationRequirement>

Požadavky na vyhodnocení.

user
ClaimsPrincipal

Uživatel, který má vyhodnotit požadavky.

resource
Object

Volitelný prostředek, se kterým by se zásady měly kontrolovat. Pokud se prostředek pro vyhodnocení zásad nevyžaduje, můžete jako hodnotu předat hodnotu null.

Návraty

Hodnota AuthorizationHandlerContext

Platí pro