For future people with a similar problem - this may depend on how you actually configure your roles for the current user.
I had a similar problem when roles were pulled from a cookie with an OnActionExecuting override in the base controller. It turns out that this was done after the [Authorize] attribute, so the roles were not actually configured when the attribute checked them. The User.IsInRole call in the view was executed after OnActionExecuting , so he saw the roles in order.
So User.IsInRole returned what I expected, but the [Authorize] attribute did not.
I was able to solve this by moving the code so that the roles were in a more reasonable place that runs before the Authorize attribute - for example, in Global.asax.cs:
protected void Application_AuthenticateRequest(Object sender, EventArgs e) {
Or even better, in your own custom attribute - see fooobar.com/questions/101863 / ....
source share