title: Checking login user AuthorizePolicy in Razor page on Asp.Net Core
body: <p>I'm looking for a variant of this </p>
  
  <pre><code>@if (SignInManager.IsSignedIn(User) &amp;&amp; User.IsInRole(Roles.Administrator))
  {
      &lt;div id="editArticle"&gt;
  </code></pre>
  
  <p>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.</p>
  
  <pre><code>[Authorize(Policy = Policies.RequireAdmin)]
  </code></pre>