安全性:处理多个用户权限
现在我的项目即将完成,我正在尝试实现登录和安全性。 我的数据库中有一个表,其中包含所有用户。 在正常的登录名和密码列旁边,我还得到了 7 个布尔值。 这些布尔值代表用户可以访问或不访问的类别(文件夹)。
用户登录后,我将记录(用户)放入我的会话中。 因此,根据这些布尔值,我将在主页中显示选项卡。
但是,当用户尚未登录或没有获得该页面的适当权限时,如何实施将用户重定向回登录的安全措施。
有人告诉我在 de global.asax 中添加一些代码,但我没有这方面的经验。不知道如何开始,似乎我在互联网上找不到任何示例
Now that my project is almost finished I am trying to implement the login and security.
I got a table in my database with all the users in it.
Next to the normal login and password columns I also got 7 booleans.
Those booleans represent the categories(folders) which the users may access or not.
After the user logins I put the record (user) in my session.
So depending on those booleans I will display tabs in my masterpage.
But how do I implent the security measures which redirects the user back to the login when they aren't logged in yet or when they don't got the proper rights to be on that page.
Somebody told me to add some code in de global.asax but I have no experience with it. And got no idea on how to start and it seems like i can't find any examples on the internet
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ASP.NET 会员资格听起来正是您所需要的。当您选择的框架已经为您处理时,从头开始编写一些东西是没有意义的,对吗?
http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx
ASP.NET Membership sounds like what you need. No point writing something from scratch when your chosen Framework will already handle it for you, right?
http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx