开发者

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")) {
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜