Display/hide menu items depending on logged on user
Posted
by Andrew
on Stack Overflow
See other posts from Stack Overflow
or by Andrew
Published on 2010-03-18T06:05:49Z
Indexed on
2010/03/18
6:11 UTC
Read the original article
Hit count: 354
asp.net-mvc
|security
In my web app, I would like to show an "Admin" menu link only to users who have been added to the database as an administrator.
What would be the best way to do this in ASP.NET MVC 2?
At the moment, I am doing it by checking whether the user exists in the Admin database table for every page. Obviously, there must be a better way to do this.
If it helps, I am using Windows Auth.
© Stack Overflow or respective owner