Update: Authorize User Roles with Attribute

Avoid overriding the Context.User in the http pipeline.
This commit is contained in:
Gary Sharp
2013-05-16 19:27:11 +10:00
parent f6904d27c9
commit 664cde59eb
22 changed files with 115 additions and 62 deletions
-9
View File
@@ -21,7 +21,6 @@ namespace Disco.Web
{
public DiscoApplication()
{
base.AuthenticateRequest += new EventHandler(DiscoApplication_AuthenticateRequest);
base.BeginRequest += new EventHandler(DiscoApplication_BeginRequest);
base.Error += new EventHandler(DiscoApplication_Error);
}
@@ -125,14 +124,6 @@ namespace Disco.Web
}
#region Authentication
void DiscoApplication_AuthenticateRequest(object sender, EventArgs e)
{
User u = CurrentUser;
if (u != null)
{
base.Context.User = new GenericPrincipal(base.Context.User.Identity, new string[] { u.Type });
}
}
public static bool InitialConfig { get; set; }