Condividi tramite


IAuthorizationHandlerContextFactory.CreateContext Metodo

Definizione

Crea un AuthorizationHandlerContext oggetto utilizzato per l'autorizzazione.

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

Parametri

requirements
IEnumerable<IAuthorizationRequirement>

Requisiti da valutare.

user
ClaimsPrincipal

Utente in cui valutare i requisiti.

resource
Object

Una risorsa facoltativa con cui devono essere controllati i criteri. Se una risorsa non è necessaria per la valutazione dei criteri, è possibile passare Null come valore.

Restituisce

Oggetto AuthorizationHandlerContext.

Si applica a