I want to be able to
Roles.GetRolesForUser(User.Identity.Name)
This can be done with a single statement:
User.IsInRole("admin");
If anyone need this information, in case your user has many roles but you're looking for one, you could do this:(i thought id share)
@if (Request.IsAuthenticated)
{
string[] roles = Roles.GetRolesForUser();
foreach (string role in roles)
{
if (role.Contains("admin"))
{
<li>@Html.ActionLink("Administration", "Admin", "Movies")</li>
break;
}
}
}