litellm/ui
Ryan Crabbe 79064a68e4
fix: allow non-admin access to /guardrails/submissions and fix register membership check
Bug 1: internal users hit route-level 403 on /guardrails/submissions.
The route wasn't in self_managed_routes, so the route allowlist rejected
non-admin callers before our endpoint's team-scoping ran. Added
/guardrails/submissions and /guardrails/submissions/{guardrail_id} to
self_managed_routes.

Bug 2: register_guardrail 403'd non-admins registering for teams in
their user.teams list. It used get_team_membership() which reads the
litellm_teammembership join table, but that row is only created when
the team has a budget (management_helpers/utils.py:225). Switched to
the _get_user_team_ids helper (reads user_obj.teams), making it
consistent with list_guardrail_submissions.

UI: moved the Test Playground tab inside the isAdmin conditional in
guardrails.tsx. Internal users now see only the Submitted Guardrails
tab; admins still see all four.

Tests: added coverage for non-admin register paths (cross-team allowed
and cross-team forbidden).
2026-04-04 16:11:28 -07:00
..
litellm-dashboard fix: allow non-admin access to /guardrails/submissions and fix register membership check 2026-04-04 16:11:28 -07:00