title: Custom Roles for ASP.NET MVC3 Application using Active Directory
body: <p>I have some roles in my AD like example role1, role2
  I want to create role in application which I can use to authenticate controllers.
  Of course I can use something like that:</p>
  
  <pre><code>[Authorize(Roles = "role1")]
  </code></pre>
  
  <p>but in case when someone change name of group in AD, then I must change this Roles in all controllers where I used it. So I'm trying to define my own roles in app which I will using in controllers:</p>
  
  <pre><code>MyRole = role1
  </code></pre>
  
  <p>Also I can here put more than one role to one in App.
  I'm trying to use something like that:</p>
  
  <pre><code>string UserName = HttpContext.Current.User.Identity.Name;
  string[] roles = Roles.GetRolesForUser(UserName);
  if (roles.Contains("role"))
  {
      Roles.CreateRole("MyRole");
      Roles.AddUserToRole(UserName, "MyRole");
  }
  </code></pre>
  
  <p>but methods <em>CreateRole</em> and <em>AddUserToRole</em> not working with windows authentication.</p>
  
  <p>Any idea how to do it?</p>