How to get MVC Sitemap provider to security trim properly
I have the following sitemap XML using mvcsitemapprovider project.
It is not hiding the following node when all of the children are not accessible to the user:
<mvcSiteMapNode url="~/Form.aspx" title="Form Editor" roles="ItemBank User" />
There is a TrimEmptyGroupingNodesVisibilityProvider for this specific purpose.
<mvcSiteMapNode url="~/Form.aspx" title="Form Editor" roles="ItemBank User" visibilityProvider="MvcSiteMapProvider.TrimEmptyGroupingNodesVisibilityProvider, MvcSiteMapProvider" />
NOTE: The default implementation requires the node to be non-clickable in order to work. However, you could make a custom visibility provider to handle this case.