public virtual async Task AuthorizeAsync(CancellationToken cancellationToken) { var authorizationAttributes = _apiActionAuthorizationProvider.Get(GetType()); if (authorizationAttributes == null || authorizationAttributes.Length == 0) { return; } var results = await Task.WhenAll(authorizationAttributes.Select(a => a.AuthorizeAsync(_httpContext, AbstractModel, cancellationToken))); ActionResponse = ActionResponse ?? results.FirstOrDefault(r => r != null); }
// ReSharper disable once MemberCanBePrivate.Global protected ApiActionResponse Response(ApiActionResponse response) { ActionResponse = response; return(response); }