Condividi tramite


DefaultAuthorizationHandlerContextFactory.CreateContext Metodo

Definizione

Crea un AuthorizationHandlerContext oggetto utilizzato per l'autorizzazione.

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

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.

Implementazioni

Si applica a