How to "add" field in asp.net application if i'm using windows authentication?
i'm using Windows authentication in an Asp.net application, and it works great. The problem is that i need to distinguish between Admin user and simple user. How can i do ? Do i need to add a table in my database where i link active directory username and .. privilegs 开发者_StackOverflow社区? Thanks
You can use the database aspnetdb that comes with your new 4.0 project in the app_data folder. if you dont see it you can click on the hammer on top of the solution explorer pane. from there you can manage users and roles.
add a new role called Admin
and in your code it can look like this :
if(User.IsInRole("Admin")) {
精彩评论