如何在asp.net中实现表单身份验证安全性?
问题描述:
我有数据库中的员工和部门,应该登录3种类型的用户
first> admin可以为部门和员工添加更新和删除记录并分配离职经理
秒>离职经理可以查看员工的部门数据
third>员工只需查看自己的数据
如何使用表单身份验证来执行此操作
i have employee and department in database and 3 types of users should be logged in
first>admin can add update and delete records for departments and employees and assign depart manager
second> depart managers can view employee''s data of their departments
third> employees just view their own data
how to use forms authentication to do this
答
首先,实现成员资格: http://msdn.microsoft.com/en-GB/library /yh26yfzy(v=vs.100).aspx [ ^ ] - 它包含角色,允许您决定谁有权访问哪些内容,还允许您限制哪些页面可供哪些角色的用户使用。
Firstly, implement Membership: http://msdn.microsoft.com/en-GB/library/yh26yfzy(v=vs.100).aspx[^] - it incorporates Roles, which allow you to decide who has access to what, and also allows you to restrict what pages are available to users in which role.
看看这些:
如何:实现简单表单身份验证 [ ^ ]
解释:ASP.NET 2.0中的表单身份验证 [ ^ ]
在ASP.NET中使用表单身份验证 - 第1部分 [ ^ ]
检查正确的配置设置和实现。
Have a look at these:
How to: Implement Simple Forms Authentication[^]
Explained: Forms Authentication in ASP.NET 2.0[^]
Using Forms Authentication in ASP.NET - Part 1[^]
Check for correct config setting and implementation.