Pergunta

I need to get know how SiteMapProvider.IsAccessibleToUser() works.

Built-in XmlSiteMapProvider calls HttpContext.User.IsInRole() which uses System.Security.Principal.GenericPrincipal in case of forms authentication.

Where does the current user gets its roles? Which provider loads this kind of information? I want to overload it and use custom logic.

Foi útil?

Solução

Outras dicas

To use custom logic, you can create your own forms authentication cookie with roles and read it back in Global.asax.

See these:

private void SetAuthenticationCookie(int employeeID, List<string> roles)

protected void Application_AuthenticateRequest(Object sender, EventArgs e)

http://weblogs.asp.net/rajbk/archive/2010/04/01/securing-an-asp-net-mvc-2-application.aspx

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top