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.
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.
[Authorize(Roles = Config.GMPUser)]
public ActionResult Index()
{
return View();
}