Release Note
http://www.asp.net/whitepapers/mvc4-release-notes
Using Asynchronous Methods in ASP.NET MVC 4
public class AdminAuthorize : AuthorizeAttribute { //return true if username is admin else return false protected override bool AuthorizeCore(HttpContextBase httpContext) { if (!httpContext.User.Identity.IsAuthenticated) { return false; } Users = httpContext.User.Identity.Name.ToLower();
return (Users == "admin"); } }