S8PermissionCatalog.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. namespace Admin.NET.Plugin.AiDOP.Const.S8;
  2. /// <summary>
  3. /// S8 权限点条目(Catalog 真源,不依赖数据库)。
  4. /// </summary>
  5. public sealed class S8PermissionItem
  6. {
  7. public string Code { get; init; } = string.Empty;
  8. public string Label { get; init; } = string.Empty;
  9. public string Group { get; init; } = string.Empty;
  10. public int SortNo { get; init; }
  11. }
  12. /// <summary>
  13. /// S8 权限点目录(B0 阶段静态 catalog;后续 B2 矩阵 / B3 v-auth / B4 后端兜底统一从此读取)。
  14. /// 命名规范:s8:&lt;resource&gt;:&lt;action&gt;
  15. /// </summary>
  16. public static class S8PermissionCatalog
  17. {
  18. public const string GroupException = "exception";
  19. public const string GroupVerification = "verification";
  20. public const string GroupConfig = "config";
  21. public const string GroupDashboard = "dashboard";
  22. private static readonly IReadOnlyList<S8PermissionItem> _all = new List<S8PermissionItem>
  23. {
  24. new() { Code = "s8:exception:read", Label = "查看异常", Group = GroupException, SortNo = 10 },
  25. new() { Code = "s8:exception:create", Label = "主动提报", Group = GroupException, SortNo = 20 },
  26. new() { Code = "s8:exception:assign", Label = "分派异常", Group = GroupException, SortNo = 30 },
  27. new() { Code = "s8:exception:claim", Label = "认领异常", Group = GroupException, SortNo = 40 },
  28. new() { Code = "s8:exception:start", Label = "开始处理", Group = GroupException, SortNo = 50 },
  29. new() { Code = "s8:exception:reject", Label = "驳回异常", Group = GroupException, SortNo = 60 },
  30. new() { Code = "s8:exception:upgrade", Label = "升级异常", Group = GroupException, SortNo = 70 },
  31. new() { Code = "s8:exception:close", Label = "关闭异常", Group = GroupException, SortNo = 80 },
  32. new() { Code = "s8:verification:submit", Label = "提交复检", Group = GroupVerification, SortNo = 110 },
  33. new() { Code = "s8:verification:approve", Label = "检验通过", Group = GroupVerification, SortNo = 120 },
  34. new() { Code = "s8:verification:reject", Label = "检验退回", Group = GroupVerification, SortNo = 130 },
  35. new() { Code = "s8:config:read", Label = "查看配置", Group = GroupConfig, SortNo = 210 },
  36. new() { Code = "s8:config:operator:bind", Label = "维护操作员绑定", Group = GroupConfig, SortNo = 220 },
  37. new() { Code = "s8:config:role:write", Label = "维护角色权限", Group = GroupConfig, SortNo = 230 },
  38. new() { Code = "s8:dashboard:read", Label = "查看看板", Group = GroupDashboard, SortNo = 310 },
  39. };
  40. public static IReadOnlyList<S8PermissionItem> All => _all;
  41. }