Sitemap is puzzling me a bit. I'm not getting security
trimming happening, and I don't see docs on how it works with anonymous users.
I'm setting up a site for both anonymous and logged-in
access.
I want the logged in users to see more menu items than anon
users. I have not made a "users" role for all users since this seems like needless
complexity - what would it mean then if a user is logged in but is not in the
"users" role?
I've also got some admin functions that only users in the
admin role can see. I've set up a Web.config and Web.sitemap that seem to be
correct, but I can still see all the items even when not logged in.
The roles specification does not seem to be working, and I
don't even see a way to specify that some items are barred from anon users.
The web.config is like this (cut down a bit):
<?xml version="1.0" encoding="utf-8"
?>
<siteMap
xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode
url="Default.aspx" title="Home" description="The main page"
roles="*">
<siteMapNode url="~/Toys/apage.aspx" title="A
page" />
<siteMapNode url="~/Admin/Adminpage.aspx" title="An admin page" roles="Administrator" />
</siteMapNode>
</siteMap>
The web.config is like this:
<system.web>
...
<siteMap
defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<add
name="XmlSiteMapProvider"
description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider"
siteMapFile="web.Sitemap"
securityTrimmingEnabled="true" />
</providers>
</siteMap>