title: Check Owin based claim on MVC5
body: <p>My <code>User.IsInRole("CanChangeData")</code> is not working, but I can see in the debug menu that the Value <code>CanChangeData</code> is in the claims list of the user.</p>
  
  <p><a href="https://i.stack.imgur.com/FgB56.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FgB56.png" alt="enter image description here"></a></p>
  
  <p>I want to remove a menu if the user cannot change data in a layout, the <code>if</code> return false. <code>Request.IsAuthenticated</code> return true.</p>
  
  <p>This is how I add the claims to the user on the <code>AuthenticationController</code></p>
  
  <pre><code>var identity = new ClaimsIdentity(new[] {
                          new Claim(ClaimTypes.Name, input.Username),
                      },
                      DefaultAuthenticationTypes.ApplicationCookie,
                      ClaimTypes.Name, ClaimTypes.Role); 
  
  var employe = db.Employes.Single(k =&gt; k.User == input.Username);
  
  foreach (var permission in employe.Role.Permissions)
  {
      identity.AddClaim(new Claim(ClaimTypes.Role, permission.Nom));
  }
  </code></pre>
  
  <p>Why  <code>User.IsInRole("CanChangeData")</code> is not catching the claim ?</p>