Quellcode durchsuchen

feat(s8): add s8 permission catalog and menu buttons

- S8PermissionCatalog: 15 static s8:* permission items grouped by exception/verification/config/dashboard
- GET /api/aidop/s8/config/permission-catalog: read-only catalog endpoint
- SysMenu seed: 15 Btn entries (Permission=s8:*) under existing S8 menus, ID range baseId+100..114
- No SysUserRole/SysRoleMenu runtime writes; no v-auth wiring; no backend perm gate; legacy AdoS8RolePermissionConfig retained for compatibility
YY968XX vor 4 Wochen
Ursprung
Commit
e909053f55

+ 45 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Const/S8/S8PermissionCatalog.cs

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

+ 21 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S8/AdoS8ConfigPermissionCatalogController.cs

@@ -0,0 +1,21 @@
+using Admin.NET.Plugin.AiDOP.Const.S8;
+
+namespace Admin.NET.Plugin.AiDOP.Controllers.S8;
+
+/// <summary>
+/// S8 权限点目录(只读)。供后续矩阵 UI / v-auth 校验列表 / 后端兜底读取统一真源。
+/// </summary>
+[ApiController]
+[Route("api/aidop/s8/config")]
+[NonUnify]
+public class AdoS8ConfigPermissionCatalogController : ControllerBase
+{
+    [HttpGet("permission-catalog")]
+    public IActionResult Get() => Ok(S8PermissionCatalog.All.Select(x => new
+    {
+        code = x.Code,
+        label = x.Label,
+        group = x.Group,
+        sortNo = x.SortNo,
+    }));
+}

+ 42 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/SeedData/SysMenuSeedData.cs

@@ -784,6 +784,48 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
                 Remark = $"S8 {title}"
             };
         }
+
+        // ── S8 权限点(Btn):与 S8PermissionCatalog 同源,命名 s8:<resource>:<action>
+        // Btn ID 段:baseId + 100..114(不与现有 Dir/Menu 冲突)。
+        const long s8DashboardId = 1322000000027L; // 见上文「S8:复用自动生成的首项菜单位…」
+        const long btnIdBase = baseId + 100;
+        const string btnNamePrefix = "aidopS8Btn";
+        var btns = new (long IdOff, long Pid, string Permission, string Title, int Order)[]
+        {
+            // 异常列表 / 任务详情
+            (0,  baseId + 2,  "s8:exception:read",         "查看异常",     10),
+            (1,  baseId + 3,  "s8:exception:create",       "主动提报",     20),
+            (2,  baseId + 10, "s8:exception:assign",       "分派异常",     30),
+            (3,  baseId + 10, "s8:exception:claim",        "认领异常",     40),
+            (4,  baseId + 10, "s8:exception:start",        "开始处理",     50),
+            (5,  baseId + 10, "s8:exception:reject",       "驳回异常",     60),
+            (6,  baseId + 10, "s8:exception:upgrade",      "升级异常",     70),
+            (7,  baseId + 10, "s8:exception:close",        "关闭异常",     80),
+            (8,  baseId + 10, "s8:verification:submit",    "提交复检",     110),
+            (9,  baseId + 10, "s8:verification:approve",   "检验通过",     120),
+            (10, baseId + 10, "s8:verification:reject",    "检验退回",     130),
+            // 配置中心
+            (11, baseId + 4,  "s8:config:read",            "查看配置",     210),
+            (12, baseId + 13, "s8:config:operator:bind",   "维护操作员绑定", 220),
+            (13, baseId + 13, "s8:config:role:write",      "维护角色权限", 230),
+            // 看板
+            (14, s8DashboardId, "s8:dashboard:read",        "查看看板",     310),
+        };
+        foreach (var (off, pid, perm, title, order) in btns)
+        {
+            yield return new SysMenu
+            {
+                Id = btnIdBase + off,
+                Pid = pid,
+                Title = title,
+                Permission = perm,
+                Name = $"{btnNamePrefix}{off:00}",
+                Type = MenuTypeEnum.Btn,
+                CreateTime = ct,
+                OrderNo = order,
+                Remark = $"S8 权限点 {perm}"
+            };
+        }
     }
 
     private static IEnumerable<SysMenu> BuildS0WarehouseMenus(DateTime ct)