Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/api/routes/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,15 @@ async def get_run(request: Request, run_id: UUID, queue_position: bool = False,

# Permission check
if deployment is not None and (deployment.environment == "public-share" or deployment.environment == "community-share"):
# Public share, no permission check
if run.user_id == user_id:
# Public share - check if current user owns the deployment
if org_id is not None and deployment.org_id == org_id:
# Current user's org owns the deployment
pass
elif org_id is not None and run.org_id == org_id:
elif deployment.user_id == user_id:
# Current user owns the deployment
pass
else:
# Not the owner, check public access permissions
apply_org_check_direct(deployment, request)
else:
apply_org_check_direct(run, request)
Expand Down