AuthorizationServiceClient.AuthorizeOrThrowAsync(ProtectedOperation, CancellationToken) Methode

Definition

Überprüft, ob der zuvor authentifizierte Benutzer autorisiert ist, einen Vorgang auszuführen, oder löst eine Ausnahme aus.

public System.Threading.Tasks.Task AuthorizeOrThrowAsync (Microsoft.ServiceHub.Framework.Services.ProtectedOperation operation, System.Threading.CancellationToken cancellationToken = default);
member this.AuthorizeOrThrowAsync : Microsoft.ServiceHub.Framework.Services.ProtectedOperation * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function AuthorizeOrThrowAsync (operation As ProtectedOperation, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameter

operation
ProtectedOperation

Der Vorgang zum Überprüfen der Autorisierung.

cancellationToken
CancellationToken

Ein Abbruchtoken.

Gibt zurück

Task

Eine Aufgabe, die erfolgreich abgeschlossen wird, wenn der Vorgang autorisiert ist, andernfalls Fehler.

Ausnahmen

Wird ausgelöst, wenn der Client nicht zum Ausführen von autorisiert ist operation .

Gilt für