基于资源的自定义授权 - 动态角色 - AuthorizeAttribute

时间:2016-06-21 18:21:07

标签: c# asp.net-core asp.net-core-mvc authorize-attribute asp.net-authorization

我想在新的ASP Core上为控制器类和方法实现基于自定义资源代码的授权。我的项目中的角色不是静态的。

喜欢的东西:

[Authorize(PermissionsEnum.AccessXYZScreen)]

如果该角色具有该权限授予访问权限。这在以前的版本中非常简单。

我读过 How do you create a custom AuthorizeAttribute in ASP.NET Core?https://docs.asp.net/en/latest/security/authorization/index.html,但它们都不符合我的需求。

0 个答案:

没有答案
相关问题