It's possible to do this manually:
C# Code:
var config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/WebsiteVirtualRootThatContainsWebConfigGoesHere");
var locations = config.Locations;
foreach (ConfigurationLocation location in locations)
{
AuthorizationSection authSection = (AuthorizationSection)location.OpenConfiguration().GetSection("system.web/authorization");
foreach (AuthorizationRule authRule in authSection.Rules)
{
switch (authRule.Action)
{
case AuthorizationRuleAction.Allow:
break;
case AuthorizationRuleAction.Deny:
break;
}
}
}
But it's much easier to just set securityTrimmingEnabled="true" for the Sitemap provider in web.config, and this will automatically trim down the Sitemap nodes when accessing from code to whatever the current user is authorized to view. If you want to check a url manually, then you can just use UrlAuthorizationModule.CheckUrlAccessForPrincipal.