如何在应用程序中区分用户 [英] how to differ user in application

查看:85
本文介绍了如何在应用程序中区分用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何区分普通用户和管理员,
我需要根据用户ID授予访问权限.管理员有权访问所有页面,但用户(不是管理员)无法访问所有页面.例如:在我的母版页中,管理员可以选择任何页面,但普通用户可以选择受限页面.如果他们选择管理页面,他就会收到类似u无法访问的消息.,

how to differ normal user and admin,
i need to give access according to the user id. admin have rights to visit all pages but users (not a admin) cant visit all pages. ex: in my master page admin can choose any pages but normal user can choose limited pages., if they choose admin page he shud get message like u cant access .,

推荐答案

这是一篇很有用的介绍性文章:
http://www.asp.net/web-forms/tutorials/security/roles/role-based-authorization-cs [ ^ ].

另请参阅此Microsoft概述,从以下位置开始:
http://msdn.microsoft.com/en-us/library/aa478958.aspx [ ^ ].

以及Microsoft模式与实践"中的文章:
http://msdn.microsoft.com/en-us/library/ff649358 [ ^ ],
http://msdn.microsoft.com/en-us/library/ff649350.aspx [ ^ ].

另请参见此CodeProject文章:
具有表单身份验证的基于角色的安全性 [
This is a useful introductory article:
http://www.asp.net/web-forms/tutorials/security/roles/role-based-authorization-cs[^].

See also this Microsoft overview, starting from:
http://msdn.microsoft.com/en-us/library/aa478958.aspx[^].

And the articles from Microsoft "Patterns & Practices":
http://msdn.microsoft.com/en-us/library/ff649358[^],
http://msdn.microsoft.com/en-us/library/ff649350.aspx[^].

See also this CodeProject article:
Role-based Security with Forms Authentication[^].

Good luck,
—SA


这篇关于如何在应用程序中区分用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆