auth.service.ts
14.3 KB
-
feat(auth): 标准数据权限 org-scope(内存树展开,不建表) · db2c0874
数据权限 = 用户的 org 范围(任意层级:集团/品牌/诊所)。expandOrgScope() 把 org 节点展开成 sourceUnits + clinicIds(已有过滤层不变): 诊所 ref → 该诊所 + 所属品牌;品牌 ref → 该品牌 + 其下全部诊所; 集团 ref / 空 → 不限。多 ref 取并集。 - org-scope.ts:jvs-dw 内存树(ruier-grp→瑞尔/瑞泰→诊所)+ expandOrgScope - 契约 exchangeToken 接 orgScope(优先于显式 sourceUnits/clinicIds)→ 展开 - TokenExchangeUserSchema 加 orgScope 验证:诊所/品牌/集团/跨品牌四级展开均正确。通用态树放 manifest yaml。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
luoqi committed