There is not a lot of information to go one here, but you need a way to determine what profile the user has. Once you have this, when the page is being built, check the users profile to see if they are an admin. If yes, then set the menu items visibility
to true if not set it to false.
HTH, Ben
Marked as answer by Sage Gu - MSFT on Jul 09, 2012 08:30 AM
dotnet_CH
Member
40 Points
259 Posts
How to restrict view of certain menu items based on profile
Jun 29, 2012 11:42 AM|LINK
Hi All,
I want to restrict the view of menu items based on profile.
Like certain menu items should be visible in admin profile only
Thanks
Perkinsville
Member
588 Points
79 Posts
Re: How to restrict view of certain menu items based on profile
Jun 29, 2012 01:04 PM|LINK
Hi,
There is not a lot of information to go one here, but you need a way to determine what profile the user has. Once you have this, when the page is being built, check the users profile to see if they are an admin. If yes, then set the menu items visibility to true if not set it to false.
HTH, Ben
BrockAllen
All-Star
27530 Points
4905 Posts
MVP
Re: How to restrict view of certain menu items based on profile
Jun 29, 2012 01:10 PM|LINK
Is this for security? You can use User.IsInRole("Admin") to determine if the user is in the role and then omit the menu item.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Himanshu Por...
Member
116 Points
40 Posts
Re: How to restrict view of certain menu items based on profile
Jun 29, 2012 01:28 PM|LINK
There are n number of ways to do this.
You can display the Menu through XML by showing the XML elements depending upon the type of user logged in.
Even you can check the Type of User and depending on that you can place the items in menu from code behind
Himanshu