ciao, che io sappia devi reimpostare i ruoli nell 'evento Request_authenticated ( nel global.asax:
innanzi tutto, quando fai il login, devi salvarti nel cookie di autenticazione la stringa contenente i ruoili: qui puoi trovare un esempio:
http://msdn.microsoft.com/it-it/libr...ionticket.aspx
A questo punto, nel global.asax metti questo codice:
Codice PHP:
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
if (Context.User != null && Context.User.Identity.IsAuthenticated)
{
//user authenticathed; let's recovery information from his "ticket"
FormsIdentity userIdentity = (FormsIdentity)Context.User.Identity;
FormsAuthenticationTicket loginUserInfo = userIdentity.Ticket;
//recovery user roles from private user data
string[] roles = loginUserInfo.UserData.Split(",".ToCharArray());
//change current identity for running in specific role.
//GenericPrincipal is an object with a Pair Identity/[associated roles]
Context.User = new GenericPrincipal(Context.User.Identity, roles);
}
}
![]()
![]()