pipeline-task/scripts/load_path.py

41 lines
979 B
Python
Raw 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
"""pipeline_task 模块 RBAC 权限注册。"""
import subprocess
MOD = "pipeline_task"
PATHS_LOGINED = [
f"/{MOD}/index.ui",
f"/{MOD}/task_list.ui",
f"/{MOD}/task_detail.ui",
f"/{MOD}/task_submit.ui",
f"/{MOD}/api/task_submit.dspy",
f"/{MOD}/api/task_list.dspy",
f"/{MOD}/api/task_detail.dspy",
f"/{MOD}/api/task_node.dspy",
f"/{MOD}/api/task_modify.dspy",
f"/{MOD}/api/task_control.dspy",
]
# any — 无需登录JS/CSS资源
PATHS_ANY = [
f"/{MOD}/pipeline_task.js",
]
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"=== pipeline_task RBAC registration ===")
register_paths()
print("Done.")