#!/usr/bin/env python3 """RBAC path registration for pipeline_core module. 2026-08-28:产线管理三功能(产线定义/产线步骤/发布记录)已移除, 对应的 pipelines / pipeline_steps / pipeline_versions / pipeline_editor CRUD 页面与 API 全部删除,注册清单同步清理。 """ import os, sys, subprocess MOD = "pipeline_core" PATHS_LOGINED = [ f"/{MOD}", ] def main(): root = os.path.expanduser("~/pipeline") if not os.path.isfile(os.path.join(root, "set_role_perm.py")): print("ERROR: pipeline root not found") sys.exit(1) set_perm = os.path.join(root, "set_role_perm.py") py = sys.executable count = 0 for path in PATHS_LOGINED: r = subprocess.run([py, set_perm, "logined", path], capture_output=True, text=True, cwd=root) if r.returncode == 0: count += 1 else: print(f" WARN: {path} -> {r.stderr.strip()[-80:]}") print(f"Registered {count}/{len(PATHS_LOGINED)} paths for {MOD}") if __name__ == "__main__": main()