ASP .NET 中的 RBAC

问题描述 投票:0回答:0

我正在使用asp .net idneitty和duende身份服务器,所以我的数据库ASPNETROLES和ApiScope(api1.read,api1.write,.....)中有2个表,我的问题是我想将这些范围分配给特定角色,但我不知道存储数据的最佳方式。我认为创建一个包含列(roleId,ScopeId,permission)的客户表是正确的或者有更好的解决方案

--------------------------------------
| RoleID | ScopeID | Permission      |
--------------------------------------
|   1    |    1    |   api1.read     |
|   1    |    2    |   api2.write    |
|   2    |    1    |   api1.read     |
|   2    |    3    |   api3.write    |
|   3    |    2    |   api.0read     |
--------------------------------------
c# asp.net authorization asp.net-identity identityserver4
© www.soinside.com 2019 - 2024. All rights reserved.