Partilhar via


IAuthorizationHandlerContextFactory.CreateContext Método

Definição

Cria um AuthorizationHandlerContext usado para autorização.

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

Parâmetros

requirements
IEnumerable<IAuthorizationRequirement>

Os requisitos a serem avaliados.

user
ClaimsPrincipal

O usuário com o qual avaliar os requisitos.

resource
Object

Um recurso opcional com o qual a política deve ser verificada. Se um recurso não for necessário para avaliação de política, você poderá passar nulo como o valor.

Retornos

O AuthorizationHandlerContext.

Aplica-se a