Checking login user AuthorizePolicy in Razor page on Asp.Net Core
I'm looking for a variant of this @if (SignInManager.IsSignedIn(User) && User.IsInRole(Roles.Administrator)) { <div id="editArticle"> but instead of checking after the role I'm after a check into the policy much like you would in a controller by doing this. [Authorize(Policy = Policies.RequireAdmin)] James P This seems similar to question asked here I found this link which may be helpful: https://docs.asp.net/en/latest/security/authorization/views.html Examples from that page: @if (await AuthorizationService.AuthorizeAsync(User, "PolicyName")) { <p>This paragraph is displayed because you