是否可以在ASP.NET身份中执行分层角色? [英] Is it possible to do a tiered role in ASP.NET identity?

查看:48
本文介绍了是否可以在ASP.NET身份中执行分层角色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



如果我的查询听起来不清楚,我会提前道歉。



我知道我能够在ASP.NET身份中创建角色。

我现在遇到的问题是我正在寻找一种创建多层管理模型的方法。



为简化起见,假设有三个组,A,B和C.

并且所有三个组都有自己的管理员来处理他们自己的组。

A组还负责B组和C组。

我正在寻找A组管理员获得B和C权利的方法将模型扩展到尽可能深和宽。



我尝试过:



我目前正在尝试手动方式将层次结构存储在另一个表中并进行查找,然后在有更新时递归地继续添加权限。

Hi All,

I apologize in advance if my query does not sound clear to you.

I know that I able to create roles in ASP.NET Identity.
The problem I am encountering now is that I am looking for a way to create a multi tier administration model.

To simplify things, assuming that there are three groups, A, B and C.
And all three groups have their own admins who handle their own groups.
Group A is also in charge of both Group B and C.
I am looking for a way for Group A's administrator to gain rights to B and C and also to expand the model to as deep and wide as possible.

What I have tried:

I am currently experimenting at manual ways of storing the hierarchy in another table and to do a lookup and then recursively keep adding the rights whenever there is an update.

推荐答案

没有o您可以使用的盒子系统,但ASP.NET Identity 2几乎可以自定义。为了拥有自己的表,您必须创建自定义 DbContext 或覆盖 IdentityDbContext 。这是起点,身份2使用的表格已经设置。



这是一篇很棒的文章,可以帮助你入门:ASP.NET Identity 2.0:实施基于组的权限管理John Atten [ ^ ]
There is no out of the box system that you can use, but ASP.NET Identity 2 is pretty much customizable. In order for you to have your own tables, you have to create a custom DbContext or override the IdentityDbContext. That is the starting point, where the tables being used by the Identity 2 are set.

Here's a great article that might help you get started: ASP.NET Identity 2.0: Implementing Group-Based Permissions Management | John Atten[^]


这篇关于是否可以在ASP.NET身份中执行分层角色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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