namespace MiGu.Server.Configs; public record WidgetGrantDto(string WidgetId, string Visibility); public record AuthRole( string Id, string Name, string Scope, List Permissions, List WidgetGrants); public record AuthUser(string Id, string Username, List Roles, bool Enabled); public record AuthRoleConfig(List Roles, List Users) { public static AuthRoleConfig Default() => new( Roles: new List { new("role-admin", "管理员", "Platform", new List { "*" }, new List()), new("role-ops", "运营", "RCSMonitor", new List { "ops.car.pause", "ops.car.resume", "ops.car.gohome", "ops.task.pause", "ops.task.cancel", "ops.task.reassign", "ops.task.boostPriority", "monitor.note.write" }, new List { new("MapEditor", "readonly"), new("CadToolbar", "hidden") }) }, Users: new List { new("u-admin", "admin", new List { "role-admin" }, true), new("u-ops", "ops", new List { "role-ops" }, true) }); } public record EffectivePermissions( string UserId, int Version, List AllowedOps, List VisibleWidgets, List AllowedPages);