How does the asp menu which is bound to the sitemap control change for different users?I've been through the book,but it does not contain w.r.t changing menu for roles....
If you are using a TreeView Control that connects to your sitemap and different user see different options, that is due to the different acces the roles that they have assigned to them have. For example, in each directory there can exist a web.config that
looks something like the following:
In that folder there are also pages that you have added to your Web.sitemap file. For a user that has any of the roles allowed, say "admin" for example, the TreeView would should those pages. If, however, the user lacked any of those roles, then those
pages would be omitted.
In otherword, the TreeView respected the access rights a user has based upon the roles assigned to them and the roles required for certain directories.
Hope that helps.
Failure is always an option. Avoid situations where it is the only option.
Yes the built-in SiteMap providers honor security trimming based on the user's account and any roles they belong to. This is not specific to the BeerHouse.
Marked as answer by ayespee on Jul 08, 2008 12:00 PM
ayespee
Member
9 Points
60 Posts
How does the Menu change?
Jun 29, 2008 10:21 AM|LINK
menu
grahamlower
Participant
1370 Points
264 Posts
Re: How does the Menu change?
Jul 02, 2008 05:46 AM|LINK
If I understand what you are asking...
If you are using a TreeView Control that connects to your sitemap and different user see different options, that is due to the different acces the roles that they have assigned to them have. For example, in each directory there can exist a web.config that looks something like the following:
<configuration>
<system.web>
<authorization>
<allow roles="admin" />
<allow roles="user" />
<allow roles="manager" />
<deny users="*" />
</authorization>
</system.web>
</configuration>
In that folder there are also pages that you have added to your Web.sitemap file. For a user that has any of the roles allowed, say "admin" for example, the TreeView would should those pages. If, however, the user lacked any of those roles, then those pages would be omitted.
In otherword, the TreeView respected the access rights a user has based upon the roles assigned to them and the roles required for certain directories.
Hope that helps.
ayespee
Member
9 Points
60 Posts
Re: How does the Menu change?
Jul 02, 2008 09:05 AM|LINK
Well I got it..I had to enable security trimming=true settings in web.config for sitemap provider
docluv
Star
12685 Points
2005 Posts
ASPInsiders
MVP
Re: How does the Menu change?
Jul 02, 2008 04:24 PM|LINK
Yes the built-in SiteMap providers honor security trimming based on the user's account and any roles they belong to. This is not specific to the BeerHouse.