title: How to check user is in many roles in asp.net identity
body: <p>Hi I need to check if a user is in one of the roles and i am confused with different versions of code that i found. Let me show you what i have at the moment first</p>
  
  <pre><code>_manager = new UserManager&lt;ApplicationUser&gt;(new UserStore&lt;ApplicationUser&gt;());
  
  var currentUser = _manager.FindById(User.Identity.GetUserId());      
  
  if (!_manager.IsInRole(currentUser.Id, "admin"))
  {
  
  }
  </code></pre>
  
  <p>And ApplicationUser</p>
  
  <pre><code>public class ApplicationUser : IdentityUser
  {        
  }
  
  public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
  {
  
  }
  </code></pre>
  
  <p>So i want to check if the user is in one of the roles. e.g. admin, controbutor, superuser, etc.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/14477757/how-can-i-check-if-a-user-is-in-any-one-of-a-few-different-roles-with-mvc4-simpl">this example</a> which seems a good one but i have to put the following changes in web.config to make it work. I didn't need to do that with my code as i have currently.</p>
  
  <pre><code>roleManager enabled="true"
  </code></pre>
  
  <p>I try to research more on <code>UserManager.IsInRole</code> but I coundn't find many about it. A bit more reading i understand the post i found is about Simple Membership.</p>
  
  <p>As I am using Identity, i should not use the code that i found (refers to the link and accepted answer) as that will be mixing of Identity and Simple Membership? Specially i refer to this line <code>Roles.GetRolesForUser</code>. Is there similar method for Identity? I think I am confused about different membership frameworks and don't know what is the proper uses. I hope someone can explain me to understand. </p>
  
  <p>(I still want the solution for the question i asked in the title but i really need to understand as well =)</p>