AdoS8RolePermissionConfig.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8;
  2. /// <summary>
  3. /// S8 角色权限配置(与系统角色表解耦的配置行;持久化对象)。
  4. /// </summary>
  5. [SugarTable("ado_s8_role_permission_config", "S8 角色权限配置")]
  6. public class AdoS8RolePermissionConfig
  7. {
  8. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  9. public long Id { get; set; }
  10. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  11. public long TenantId { get; set; }
  12. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  13. public long FactoryId { get; set; }
  14. [SugarColumn(ColumnName = "role_code", Length = 64)]
  15. public string RoleCode { get; set; } = string.Empty;
  16. [SugarColumn(ColumnName = "permission_codes", Length = 4000, IsNullable = true)]
  17. public string? PermissionCodes { get; set; }
  18. [SugarColumn(ColumnName = "created_at")]
  19. public DateTime CreatedAt { get; set; } = DateTime.Now;
  20. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  21. public DateTime? UpdatedAt { get; set; }
  22. /// <summary>
  23. /// S8-STEP6B-CFG-ROLES-CLOSURE-1:作用域标识(不落库),与 AdoS8ExceptionType / AdoS8DashboardCellConfig 同构。
  24. /// GLOBAL = 平台默认(租户侧只读);FACTORY = 当前工厂覆盖。
  25. /// 前端据此渲染「配置来源」并禁用平台默认行的编辑 / 删除——按 S8ConfigScope 契约,
  26. /// 「不允许在页面上给出最终只会 404 的编辑动作」。
  27. /// </summary>
  28. [SugarColumn(IsIgnore = true)]
  29. public string Scope => Admin.NET.Plugin.AiDOP.Infrastructure.S8ConfigScope.Resolve(TenantId, FactoryId);
  30. /// <summary>
  31. /// S8-STEP6B-CFG-ROLES-CLOSURE-1:本行 role_code 是否存在平台默认行(不落库,由 ListAsync 赋值)。
  32. /// true = 平台默认的工厂覆盖;false = 本工厂自建。
  33. /// </summary>
  34. [SugarColumn(IsIgnore = true)]
  35. public bool HasGlobalDefault { get; set; }
  36. }