litellm/ui
Cursor Agent ca2dc46d0f
fix(ui): skip org-list fetch in useCan when capability cannot open for org admins
useCan started calling useIsOrgAdmin unconditionally in PR #36478 so it could
opt viewDeletedTeams open for organization admins, but useIsOrgAdmin drives a
useOrganizations query, so every role-gated page now fires GET /organization/list
just to compute a denial. The Memory, Workflows and Guardrails Monitor page
tests catch this: they set up a non-admin session, expect the admin-only notice,
and assert fetch was never called; instead the organization list is requested
and the assertion fails 12 times.

Track which capabilities actually opt org admins in (only viewDeletedTeams
today) via capabilityRequiresOrgAdmin, thread an enabled flag from useCan
through useIsOrgAdmin into useOrganizations, and treat the org-admin membership
lookup as false while disabled so hasCapability sees no false positive. The
existing role gates for viewMemory, viewWorkflowRuns, viewGuardrailUsage,
viewProxyWideCostData never look at isOrgAdmin, so this is a pure fetch skip.

Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
2026-08-12 05:34:29 +00:00
..
litellm-dashboard fix(ui): skip org-list fetch in useCan when capability cannot open for org admins 2026-08-12 05:34:29 +00:00
Dockerfile chore(build): move the Admin UI toolchain to Node 24 (#35801) 2026-08-04 12:36:07 -07:00
nginx.conf fix(ui): serve /ui/assets from the nginx image instead of SPA fallback (#34066) 2026-07-21 09:22:02 -07:00