ASP.NET,如何管理用户提供不同类型的角色 [英] ASP.NET, how to manage users with different types of roles
问题描述
我要创建各种用户的网站。用户可以有不同的角色,管理员和用户,这是一个很好的记录的情况。不过,我想也组他们的位置的用户,所以在每个位置我可以同时拥有管理员和用户。 - ?一个多维的角色系统
I want to create a website with various users. The users can have different roles, admin and user, which is a very well documented situation. But I would like to also group the users on their location, so at each location I can have both admins and users. - A multi dimensional role system?
究其原因,在德国的用户应该有机会获得一组特定的文件,而意大利的用户不应该的。
The reason is, that users in Germany should have access to a certain set of documents, while the Italian users shouldn't.
在哪里我应该寻找文档在这个特定的主题?我需要一些方法来限制我的搜索,也许一些关键字。
Where should I look for documentation on this specific topic? I need some way to limit my search, maybe some keywords.
推荐答案
一个不同的方法将另增加一组角色,可用不同的位置对应的,例如德国
和意大利
。然后你让的所有的的德国
角色的德国用户成员,以及两者的德国管理员成员德国
和管理
。当检查的权限,您再检查都为管理
和当前的语言环境。
A different approach would be to add another set of roles, corresponding with the different locations available, for example Germany
and Italy
. You then make all German users members of the Germany
role, and the German admins members of both Germany
and Admin
. When checking permissions, you then check both for Admin
and for the current locale.
请记住,一个用户可以有多个角色。
Remember, one user can have many roles.
这篇关于ASP.NET,如何管理用户提供不同类型的角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!