Reputation: 8295
I want to create a sitemap for my application. Is it possible to point a node to a folder so all pages in this folder will have the role set by the node?
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Private Pages" roles="Provate" url="">
<siteMapNode title="Secure folder" url="/MainFolder">
</siteMapNode>
</siteMapNode>
Thanks to anyone who can help
Upvotes: 1
Views: 370
Reputation: 48314
Roles for a folder are not set in your sitemap. You should rather create a local web.config
file in the folder and setup your authorization rules there.
What you CAN do in a sitemap is to have a node visible or invisible to users and all subnodes can inherit the setting.
Note that whether or not a user can SEE a link in your menu is not related to whether or not the user can ACCESS the resource by pointing the browser to resource's url.
That's why you should have both: authorization rules in local configuration files (to prevent users from accessing resources) and sitemap rules (to prevent users from seeing links in the menu).
Upvotes: 1