ymq 71576381bd feat: account_resource 资源模块
参照 llmage 范式(llm主表无ppid + llm_api_map挂ppid + llmusage计费六件套):
- 资源主表不带 ppid,定价挂在「资源×用法」映射表上
- 对外统一 resolve_ppid(resource_ref_id, ctx),load 时注册到产品层解析器注册表
- 含 models 四段式/json CRUD/i18n四语言/load_path/init 种子数据
2026-08-26 14:51:27 +08:00

34 lines
929 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
"""RBAC path registration for account_resource module.
宿主根目录执行py3/bin/python pkgs/account_resource/scripts/load_path.py
pipeline-app 的 load_path.sh 自动扫描 pkgs/*/scripts/load_path.py
"""
import subprocess
MOD = "account_resource"
PATHS_ANY = []
PATHS_LOGINED = [
f"/{MOD}",
f"/{MOD}/acctres_spec/index.ui",
f"/{MOD}/acctres_pricing_map/index.ui",
f"/{MOD}/acctres_usage/index.ui",
]
def register_paths():
for path in PATHS_ANY:
subprocess.run(["py3/bin/python", "set_role_perm.py", "any", path])
print(f" any: {path}")
for path in PATHS_LOGINED:
subprocess.run(["py3/bin/python", "set_role_perm.py", "logined", path])
print(f" logined: {path}")
if __name__ == "__main__":
print(f"=== {MOD} RBAC registration ===")
register_paths()
print(f"Done. any={len(PATHS_ANY)} logined={len(PATHS_LOGINED)}")