protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
var currentUser = DependencyResolver.Current.GetService<IAppContext>().User;
HttpContext.Current.User =
currentUser == null ? null : new GenericPrincipal(new GenericIdentity(currentUser.RelatedPerson.Email), null);
}