Sdílet prostřednictvím


DefaultAuthorizationService.AuthorizeAsync Metoda

Definice

Přetížení

AuthorizeAsync(ClaimsPrincipal, Object, IEnumerable<IAuthorizationRequirement>)

Zkontroluje, jestli uživatel splňuje konkrétní sadu požadavků pro zadaný prostředek.

AuthorizeAsync(ClaimsPrincipal, Object, String)

Zkontroluje, jestli uživatel splňuje konkrétní zásady autorizace.

AuthorizeAsync(ClaimsPrincipal, Object, IEnumerable<IAuthorizationRequirement>)

Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs

Zkontroluje, jestli uživatel splňuje konkrétní sadu požadavků pro zadaný prostředek.

public:
 virtual System::Threading::Tasks::Task<bool> ^ AuthorizeAsync(System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements);
public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::AuthorizationResult ^> ^ AuthorizeAsync(System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements);
public System.Threading.Tasks.Task<bool> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object resource, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object resource, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object? resource, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements);
abstract member AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> -> System.Threading.Tasks.Task<bool>
override this.AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> -> System.Threading.Tasks.Task<bool>
abstract member AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
override this.AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
Public Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, requirements As IEnumerable(Of IAuthorizationRequirement)) As Task(Of Boolean)
Public Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, requirements As IEnumerable(Of IAuthorizationRequirement)) As Task(Of AuthorizationResult)
Public Overridable Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, requirements As IEnumerable(Of IAuthorizationRequirement)) As Task(Of AuthorizationResult)

Parametry

user
ClaimsPrincipal

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

resource
Object

Prostředek k vyhodnocení požadavků.

requirements
IEnumerable<IAuthorizationRequirement>

Požadavky, které se mají vyhodnotit.

Návraty

Příznak označující, jestli byla autorizace úspěšná. Tato hodnota je true, když uživatel splní zásady, jinak false.

Implementuje

Platí pro

AuthorizeAsync(ClaimsPrincipal, Object, String)

Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs
Zdroj:
DefaultAuthorizationService.cs

Zkontroluje, jestli uživatel splňuje konkrétní zásady autorizace.

public:
 virtual System::Threading::Tasks::Task<bool> ^ AuthorizeAsync(System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, System::String ^ policyName);
public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::AuthorizationResult ^> ^ AuthorizeAsync(System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, System::String ^ policyName);
public System.Threading.Tasks.Task<bool> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object resource, string policyName);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object resource, string policyName);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object? resource, string policyName);
abstract member AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * string -> System.Threading.Tasks.Task<bool>
override this.AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * string -> System.Threading.Tasks.Task<bool>
abstract member AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
override this.AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
Public Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, policyName As String) As Task(Of Boolean)
Public Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, policyName As String) As Task(Of AuthorizationResult)
Public Overridable Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, policyName As String) As Task(Of AuthorizationResult)

Parametry

user
ClaimsPrincipal

Uživatel, který má zásadu zkontrolovat.

resource
Object

Prostředek, se kterým by se zásady měly zkontrolovat.

policyName
String

Název zásady, která se má zkontrolovat v konkrétním kontextu.

Návraty

Příznak označující, jestli byla autorizace úspěšná. Tato hodnota je true, když uživatel splní zásady jinak false.

Implementuje

Platí pro