i have a lot of code like this in my controllers:
private void PopulateAdminStatus()
{
if (User.IsInRole("Administrator"))
{
ViewData["isAdmin"] = true;
}
else
{
ViewData["isAdmin"] = false;
}
}
the only reason i need to do this is to have my Views check admin status (as it shows different things on the view)
is there any cleaner way to have the Views have access to the User object without going through ViewData?