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.

+1  A: 

You do this by implementing a RoleProvider. Check out these links:

To be more precise, `public override bool IsUserInRole(string userName, string roleName) { }`
Yes. As an aside, two extension methods I like to make to extend the base-class of User (System.Security.Principal.IPrincipal) are "IsInAnyRole(string[])" and "IsInAllRoles(string[])" to check if a user is in ALL the roles or ANY of the roles in the passed in array. These can be useful for complex role logic. Implementation as your own exercise.
+1  A: 

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)

Raj Kaimal