Commit Graph
8 Commits
Author SHA1 Message Date
what 5cdf1cc00d 重构: 虚拟资源改用 NewVirtualResource 显式构造,移除 WithVirtual
WithVirtual(bool) 只是给 New() 打一个标记位,虚拟资源需要的表达式(子查询)没有
承载的地方,之前借用 table string 字段硬拼字符串。改成 NewVirtualResource(res,
code, table, opts...) 专门构造:table 参数直接接收 exp.SQLExpression,
GetTableExpr 对虚拟资源直接用它生成子查询表达式,不用再手工拼括号和字符串;
container/conn/historyRoles 从传入的父资源上直接复用。

GetTableExpr 返回值类型从 exp.LiteralExpression 放宽成 exp.Aliaseable,
兼容 db.T(...)(IdentifierExpression)和 db.L(...)(LiteralExpression)两种
返回值。
2026-08-20 15:58:03 +08:00
what acb55bb53a 重构: ResScope 改成 ResFlags 位标志,行级过滤与字段脱敏拆成独立开关
ResScope(Off/On/All 三选一)改成 ResFlags 位标志:ResRow/ResRowRelations 管行级权限过滤,ResMask/ResMaskRelations 管字段级脱敏,两个维度可以按位独立组合(*Relations 那两位只保留定义,还没接入判断逻辑)。WithRolesScope 改名 WithPermission(req.ResFlags),dataProcessor 里原来单一的 skipPermission 拆成 skipRowFilter/skipFieldMask 分别控制。
2026-07-22 14:03:33 +08:00
what cc3f6d90e7 重构: ResAuthDB 重命名为 ResScope,统一权限过滤范围命名
原名字跟"身份认证"(Auth)容易混淆,实际控制的是资源查询/写入时按角色过滤的范围(关闭/仅自身/含关联资源),改用 Scope 更准确。ResAuthOff/On/All 同步改名为 ResScopeOff/On/All,数值保持不变,兼容数据库里已有的 is_auth_db 存量数据。
2026-07-21 18:00:39 +08:00
what 4ef8c130a7 [feat] 类型调整 int => byte 2024-05-09 11:44:00 +08:00
what f8a11598db [feat] 类型调整 int => byte 2024-05-09 11:39:36 +08:00
what 6501b5ed0f [feat] 类型调整 int => byte 2024-05-09 11:16:26 +08:00
what f00b993f9c [feat] 移除 GetResource, 由 git.fsdpf.net/go/contracts 支持 2024-05-09 11:13:32 +08:00
what 672fc634ef first commit 2024-05-08 21:35:26 +08:00