I would like to control views in my action based on user roles. Roles are stored in database, I have overwritten my AuthorizeCore
to return true or false based on who is authorized to access the view. I need to know the userRole
in my controller.
How can I determine the role(s) for the current user?
[Authorize]
public ActionResult Index() {
if (userRole = "Admin") { return View("Admin");}
else {return View("Viewer");
}