The post above was really helpful (Thanks Serv, vote if my reputation allowed me). This helped me solve the problem I was facing, with slight minor changes in line with what I was trying to achieve. My particular problem was that I wanted to check the appearance of MVC if the current user was in this role group. I also found that Roles.IsUserInRole no longer works.
If you do this in a view, but using the ASP.NET 2.0 identifier instead of the simple membership provider provided by previous versions of MVC, the following might be useful as a one-line solution:
bool isAdmin = HttpContext.Current.User.IsInRole("Admin");
Then you can combine it with HTML to selectively display menu items (for which I used it):
@if (isAdmin) { <li>@Html.ActionLink("Users", "List", "Account")</li> }
This allows me to deny access to user management hyperlinks where the user is not a member of the "Admin" role.
Richl source share