feat: add repair timeline read APIs
This commit is contained in:
1 parent
f6a2512e23
commit
36a0caecd8
16 files changed
+1562
-9
No files matched your search
@@ -671,11 +671,24 @@ def machine_agent_request(path: str) -> bool:
|
||||
return path in exact
|
||||
|
||||
|
||||
def repair_timeline_request(path: str) -> bool:
|
||||
parts = path.split("/")
|
||||
if len(parts) == 4 and parts[:3] == ["", "api", "repairs"]:
|
||||
return parts[3] not in {"queue", "parts-summary"}
|
||||
return (
|
||||
len(parts) == 5
|
||||
and parts[:3] == ["", "api", "repairs"]
|
||||
and parts[4] == "events"
|
||||
)
|
||||
|
||||
|
||||
def required_api_permission(method: str, path: str) -> str | None:
|
||||
if path.startswith("/api/admin/"):
|
||||
return "users.manage"
|
||||
if method == "POST" and path == "/api/repairs":
|
||||
return "repairs.create"
|
||||
if method == "GET" and repair_timeline_request(path):
|
||||
return "repairs.read"
|
||||
if method == "GET":
|
||||
if path.startswith("/api/system/"):
|
||||
return "system_health.view"
|
||||
|
||||
Reference in new issue
Block a user