如何动态限制用户 [英] how to restrict users dynamically

查看:103
本文介绍了如何动态限制用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

管理员可以查看所有页面.,
管理员将与
一起创建用户 用户名和密码以及
他将选择.aspx页的
用户应该只访问关注的页面
用户可以进行交互,

admin can see all pages.,
admin will create users along with
username and password., as well as
he will choose the .aspx pages to which
users should access those pages only the concern
users can interact,

推荐答案


好了,您可以制作表格并列出其上的所有页面,表格将像ID,页面名称,标志.
Flag 列将是位True/False,并且用户和页面表之间将出现垃圾表,您可以为每个用户分配他将访问该页面的页面.这是针对数据库的.
对于应用程序,您可以创建自己的安全模块类,也可以简单地使会话包含用户的所有可访问"页面,并在该页面的每个页面上检查该会话是否被授权访问.
希望我做对了,这对您有帮助.
最好的问候
M.Mitwalli
Hi ,
Well you can make table and list all pages on it , Table will be like ID , page name , Flag .
Flag Column will be bit True/False and there will be like Junk table between user and Page Table you can assign for each user what pages he will access to it .this is for DataBase .
For Application you can make your own class for security module or simply you can make session contains all Accessible page for user and on every page check on this session if he authorized to access to this page or not .
Hope i get it right and this help you.
Best Regards
M.Mitwalli


根据您的问题,我目前正在了解您需要为Admin用户提供完全访问权限,并根据他们的角色来限制其他用户.看看下面的答案线程:
如何显示或在内部页面中为不同用户隐藏某些内容 [
As per your question, I am currently making out that you need to provide Admin user complete access and restrict other users based on their roles. Have a look at below Answer thread:
how to show or hide something in inner page for different users[^]


嗯,您所要求的最好由内置的ASP.NET来处理角色.管理员可以设置不同的角色,并为用户分配角色之一.应用程序将由登录用户的角色驱动.

阅读这些内容,以获取有关其设置和工作方式的更多知识:
视频:ASP.NET教程-成员资格和角色-第1部分 [ MSDN:如何:在ASP.NET中使用角色管理器 [了解ASP.NET角色和成员资格-入门教程 [ ^ ]
Well, what you ask is best handled by ASP.NET inbuilt Roles. Admin can set different roles and assign users one of the roles. Application will be role driven for the logged in user.

Have a read on these to get more knowledge on how it is set and works:
Video: ASP.NET Tutorial - Membership and Roles - Part1[^]
MSDN: How To: Use Role Manager in ASP.NET [^]
Understanding ASP.NET Roles and Membership - A Beginner''s Tutorial[^]


这篇关于如何动态限制用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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