title: ASP.NET MVC How to create a custom role provider
body: <p>Being relatively new to ASP MVC, I'm unsure which would better suit my needs. I have built an intranet site using Windows authentication and I'm able to secure controllers and actions using the Active Directory roles, e.g.</p>
  
  <pre><code>[Authorize(Roles="Administrators")]
  [Authorize(Users="DOMAIN\User")]
  public ActionResult SecureArea()
  {
      ViewBag.Message = "This is a secure area.";
      return View();
  }
  </code></pre>
  
  <p>I need to define my own security roles independent of the AD roles. The desired functionality is that authenticated users are granted access to specific actions according to one or more roles associated with their profile in my application database e.g: "Manager", "User", "Guest", "Analyst", "Developer" etc.</p>
  
  <p><strong>How do I create a custom role provider and/or custom authorization attribute(s)?</strong></p>