Udostępnij za pośrednictwem


IAuthorizationHandlerContextFactory.CreateContext Metoda

Definicja

Tworzy element AuthorizationHandlerContext używany do autoryzacji.

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>

Wymagania do oceny.

user
ClaimsPrincipal

Użytkownik ocenia wymagania.

resource
Object

Opcjonalny zasób, za pomocą których należy sprawdzić zasady. Jeśli zasób nie jest wymagany do oceny zasad, możesz przekazać wartość null jako wartość.

Zwraca

Element AuthorizationHandlerContext.

Dotyczy