Feb 27, 2020 12:24 AM|bootzilla|LINK
I get this error trying to modify the UI based on user authorization.
This is the code on my View page where I get the error.
@if (await AuthorizationService.AuthorizeAsync(User, "EditDiscussions"))
This is what I have on retrieving an instance of IAuthorizationService. I tried replacing <AuthorizationResult> with <bool> but that didn't work.
public interface IAuthorizationService
Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements);
Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, string policyName);