#!/usr/bin/env python3 """RBAC path registration for pipeline_dist + showcase modules.""" import os, sys, subprocess MODS = [ ("pipeline_dist", [ "/pipeline_dist", "/pipeline_dist/index.ui", "/pipeline_dist/distributors/index.ui", "/pipeline_dist/distributor_pipeline/index.ui", ]), ("showcase", [ "/showcase", "/showcase/index.ui", ]), ] def main(): root = os.path.expanduser("~/pipeline") set_perm = os.path.join(root, "set_role_perm.py") if not os.path.isfile(set_perm): print("ERROR: pipeline root not found"); sys.exit(1) py = sys.executable count = 0 total = 0 for mod, paths in MODS: total += len(paths) for path in paths: 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}") print(f" {mod}: {len(paths)} paths") print(f"Registered {count}/{total}") if __name__ == "__main__": main()