AuthorizationServiceExtensions.AuthorizeOrThrowAsync(IAuthorizationService, ProtectedOperation, CancellationToken) Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Überprüft, ob der zuvor authentifizierte Benutzer autorisiert ist, einen Vorgang auszuführen, oder löst eine Ausnahme aus.
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task ^ AuthorizeOrThrowAsync(Microsoft::ServiceHub::Framework::Services::IAuthorizationService ^ authorizationService, Microsoft::ServiceHub::Framework::Services::ProtectedOperation ^ operation, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task AuthorizeOrThrowAsync (this Microsoft.ServiceHub.Framework.Services.IAuthorizationService authorizationService, Microsoft.ServiceHub.Framework.Services.ProtectedOperation operation, System.Threading.CancellationToken cancellationToken);
static member AuthorizeOrThrowAsync : Microsoft.ServiceHub.Framework.Services.IAuthorizationService * Microsoft.ServiceHub.Framework.Services.ProtectedOperation * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function AuthorizeOrThrowAsync (authorizationService As IAuthorizationService, operation As ProtectedOperation, cancellationToken As CancellationToken) As Task
Parameter
- authorizationService
- IAuthorizationService
Der Autorisierungs Dienst.
- operation
- ProtectedOperation
Der Vorgang zum Überprüfen der Autorisierung.
- cancellationToken
- CancellationToken
Ein Abbruchtoken.
Gibt zurück
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 .