- 12张 bid_* 表(models+DDL+CRUD):招标信息/邮箱配置/人员/招标文件/评分项/资质/ 投标文件要求/章节/评审/评分/知识库/标书 - 7个角色能力模块(bid_*_capability):采集摘要/解析/知识库资质/编写/评审/合成/评分 - bid_flow 状态对账器:角色任务唯一创建者+阻塞门禁(源头守门,引擎零特判) - bid_mail:阿里云企业邮 IMAP 采集(凭据存DB AES,客户端专用密码兼容) - 能力包注册(bid_ability)+ 角色工具自注册(role_tool_schemas) - 技能:6 common 状态机/规范 + 9 角色技能(pipelines/bidding_general,随 pipeline-core 部署) - i18n(zh/en)、init/data.json(appcodes+pipelines记录)、build.sh、RBAC load_path
65 lines
1.8 KiB
Python
65 lines
1.8 KiB
Python
#!/usr/bin/env python3
|
||
"""RBAC path registration for pipeline-bidding module.
|
||
|
||
与平台惯例一致:静态资源 → any(免登录),页面/CRUD/API → logined。
|
||
由宿主应用根目录执行:py3/bin/python pkgs/pipeline-bidding/scripts/load_path.py
|
||
"""
|
||
import subprocess
|
||
import sys
|
||
|
||
MOD = "pipeline-bidding"
|
||
|
||
TABLES = [
|
||
"bid_mail_accounts", "bid_tenders", "bid_members", "bid_tender_files",
|
||
"bid_scoring_items", "bid_qualifications", "bid_doc_requirements",
|
||
"bid_chapters", "bid_reviews", "bid_scores", "bid_kb_docs", "bid_documents",
|
||
]
|
||
|
||
PATHS_ANY = [
|
||
"/imgs/node-expand.svg",
|
||
"/imgs/node-collapse.svg",
|
||
"/imgs/open-folder.svg",
|
||
"/imgs/close-folder.svg",
|
||
]
|
||
|
||
PATHS_LOGINED = [
|
||
"/%s" % MOD,
|
||
"/%s/index.ui" % MOD,
|
||
]
|
||
for t in TABLES:
|
||
PATHS_LOGINED += [
|
||
"/%s/%s/index.ui" % (MOD, t),
|
||
"/%s/%s/get_%s.dspy" % (MOD, t, t),
|
||
"/%s/%s/add_%s.dspy" % (MOD, t, t),
|
||
"/%s/%s/update_%s.dspy" % (MOD, t, t),
|
||
"/%s/%s/delete_%s.dspy" % (MOD, t, t),
|
||
]
|
||
# 产线业务 API(当前无自写 dspy;保留结构,后续新增在此登记)
|
||
PATHS_LOGINED += [
|
||
"/%s/api/" % MOD,
|
||
]
|
||
|
||
|
||
def _run(role, path):
|
||
r = subprocess.run([sys.executable, "set_role_perm.py", role, path],
|
||
capture_output=True, text=True)
|
||
if r.returncode != 0:
|
||
print(" FAIL [%s] %s: %s" % (role, path, (r.stderr or "").strip()[:120]))
|
||
return r.returncode == 0
|
||
|
||
|
||
def main():
|
||
print("=== %s RBAC registration ===" % MOD)
|
||
n = 0
|
||
for p in PATHS_ANY:
|
||
n += _run("any", p)
|
||
print(" any: %s" % p)
|
||
for p in PATHS_LOGINED:
|
||
n += _run("logined", p)
|
||
print(" logined: %s" % p)
|
||
print("Done. %d/%d paths registered" % (n, len(PATHS_ANY) + len(PATHS_LOGINED)))
|
||
|
||
|
||
if __name__ == "__main__":
|
||
main()
|