feat: org scope 缺省继承——ocai(org_id='0')机构技能所有组织共享,其他组织可覆盖

机构技能层架构:org_id='0' 是 ocai 组织(缺省机构),其机构技能(基础模块
apppublic/sqlor/ahserver/rbac/appbase/accounting 的应用/模块规范)是所有组织
缺省共享的内容;其他组织(org_id≠'0')先继承 ocai 缺省,再用自己 org scope
的同名技能覆盖(很多组织有自己的开发规范)。

get_merged 改为:先 update _orgs['0'](ocai 缺省),再 update _orgs[org_id]
(组织自有,org_id≠'0' 时),实现缺省继承 + 组织覆盖。
This commit is contained in:
yumoqing 2026-08-23 21:40:08 +08:00
parent 94bb572785
commit 48a26e5375

View File

@ -321,7 +321,9 @@ class SkillLoader:
"""按优先级合并七级技能。同名技能高优先级覆盖低优先级。
优先级global project_common pipeline org project role user
"""
org scope 缺省继承org_id='0' ocai 组织缺省机构其机构技能是所有组织共享的
缺省内容其他组织org_id'0'先继承 ocai 的机构技能再用自己 org scope 的同名技能覆盖
很多组织有自己的开发规范"""
merged = dict(self._global)
# 项目通用projects/,所有项目共享)
@ -330,7 +332,12 @@ class SkillLoader:
if pipeline_id and pipeline_id in self._pipelines:
merged.update(self._pipelines[pipeline_id])
if org_id and org_id in self._orgs:
# 缺省机构技能ocaiorg_id='0')的机构技能,所有组织缺省共享
if '0' in self._orgs:
merged.update(self._orgs['0'])
# 组织自有机构技能覆盖 ocai 缺省org_id='0' 已在上一步加载,跳过重复)
if org_id and org_id != '0' and org_id in self._orgs:
merged.update(self._orgs[org_id])
# 项目私有orgs/{org_id}/{project_id}/