title: ASP.NET MVC: Problem setting the Authorize attribute Role from a variable, requires const
body: <p>I am having a problem setting the Authorize attribute Role value from a variable. The error message says it requires a const variable.  When I create a const type variable it works fine but I am trying to load the value from the Web.Config file or anything else that will allow the end user to set this.  I'm using integrated Windows authentication since this is an intranet only application.</p>
  
  <p>Is there a way to check the users role from a controller?  I will use this in an if statement to authenticate instead of an attribute.</p>
  
  <pre><code>[Authorize(Roles = Config.GMPUser)]
  public ActionResult Index()
     {
        return View();
     }
  </code></pre>