[Fix] UI - Default Team Settings: Add Missing Permission Options#24039
[Fix] UI - Default Team Settings: Add Missing Permission Options#24039yuneng-jiang merged 1 commit intolitellm_yj_march_18_2026from
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds four previously-missing routes ( Key observations:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/TeamSSOSettings.tsx | Adds 4 missing routes (/key/info, /key/list, /key/aliases, /team/daily/activity) to PERMISSION_OPTIONS, bringing the frontend back in sync with the backend KeyManagementRoutes enum. The change is correct and low-risk, but the static hardcoded list remains a maintenance hazard since the backend already provides a dynamic /team/permissions_list endpoint. |
Sequence Diagram
sequenceDiagram
participant UI as TeamSSOSettings UI
participant API as LiteLLM Proxy API
participant DB as Database
UI->>API: GET /team/default_settings
API-->>UI: DefaultTeamSSOParams (incl. team_member_permissions)
UI->>UI: Populate dropdown from hardcoded PERMISSION_OPTIONS
Note over UI: User selects permissions & saves
UI->>API: POST /team/update_default_settings (team_member_permissions=[...])
API->>DB: Persist DefaultTeamSSOParams
Note over API,DB: On new team creation via SSO
API->>DB: Create team with default team_member_permissions
API->>API: get_permissions_for_team_member()
Note right of API: Always adds BASELINE_TEAM_MEMBER_PERMISSIONS<br>(/key/info + /key/health)
API-->>API: Final effective permissions = stored + baseline
Note over UI,API: Alternative (not yet implemented):<br>UI could call GET /team/permissions_list<br>to dynamically populate PERMISSION_OPTIONS
Comments Outside Diff (1)
-
ui/litellm-dashboard/src/components/TeamSSOSettings.tsx, line 18-33 (link)Hardcoded list will drift from backend again
PERMISSION_OPTIONSis a static frontend array that must now be manually kept in sync with the backend'sKeyManagementRoutesenum (inlitellm/proxy/_types.py). The backend already exposes a dynamic endpoint —GET /team/permissions_list— that callsTeamMemberPermissionChecks.get_all_available_team_member_permissions()and returns exactly this list at runtime.The root cause of this bug (missing routes) was precisely that the hardcoded list fell out of sync. After this fix, the two are aligned again, but the next time a route is added to
KeyManagementRoutesthe UI will silently lag behind until someone notices and opens another PR.Consider fetching the options dynamically in the
useEffecthook, similar to howgetDefaultTeamSettingsis already called:// In fetchSettings: const [permissionOptions, setPermissionOptions] = useState<string[]>([]); // ... const permissions = await fetchTeamPermissionsList(accessToken); // calls GET /team/permissions_list setPermissionOptions(permissions);
This would make the dropdown self-updating any time the backend is extended.
Last reviewed commit: "Add missing permissi..."
| "/key/info", | ||
| "/key/list", | ||
| "/key/aliases", | ||
| "/team/daily/activity", |
There was a problem hiding this comment.
/key/info in dropdown contradicts "always included" description
/key/info is listed as a selectable option in PERMISSION_OPTIONS (line 29), but the SettingRow description on line 297 explicitly states: "/key/info and /key/health are always included."
This is contradictory: if /key/info is always granted automatically, it should NOT be a user-selectable option (a user might uncheck it, believing it was removed, when in reality it still applies). /key/health is consistently absent from the dropdown — it appears the same treatment was intended for /key/info.
Either:
- Remove
/key/infofromPERMISSION_OPTIONS(matching the treatment of/key/healthand the description), or - Update the description to clarify that only
/key/healthis always included, and/key/infois optional.
| "/key/info", | |
| "/key/list", | |
| "/key/aliases", | |
| "/team/daily/activity", | |
| "/key/generate", | |
| "/key/update", | |
| "/key/delete", | |
| "/key/regenerate", | |
| "/key/service-account/generate", | |
| "/key/{key_id}/regenerate", | |
| "/key/block", | |
| "/key/unblock", | |
| "/key/bulk_update", | |
| "/key/{key_id}/reset_spend", | |
| "/key/list", | |
| "/key/aliases", | |
| "/team/daily/activity", |
| interface TeamSSOSettingsProps { | ||
| accessToken: string | null; | ||
| userID: string; | ||
| userRole: string; | ||
| } |
There was a problem hiding this comment.
Unused props
userID and userRole in interface
The TeamSSOSettingsProps interface still declares userID: string and userRole: string, but the component destructures only { accessToken } (line 88). Both callers (TeamsView.tsx:339 and OldTeams.tsx:1029) pass these props, but they are silently ignored inside the component.
These were previously used to fetch available models via modelAvailableCall, which was removed in this PR. Consider removing the unused props from the interface (and the corresponding call sites) to keep the public API clean and avoid misleading future readers.
| interface TeamSSOSettingsProps { | |
| accessToken: string | null; | |
| userID: string; | |
| userRole: string; | |
| } | |
| interface TeamSSOSettingsProps { | |
| accessToken: string | null; | |
| } |
Adds /key/info, /key/list, /key/aliases, and /team/daily/activity to the hardcoded PERMISSION_OPTIONS in TeamSSOSettings.tsx. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bbf2e18 to
eb7efa3
Compare
83d185d
into
litellm_yj_march_18_2026
[Fix] UI - Default Team Settings: Add Missing Permission Options
Summary
Problem
The
PERMISSION_OPTIONSconstant inTeamSSOSettings.tsxwas missing/key/aliases,/team/daily/activity,/key/info, and/key/list. Users could not see or select these permissions in the Default Team Settings UI.Fix
Added the missing permission routes to
PERMISSION_OPTIONS. Also addedteam_member_permissionsfield to theDefaultTeamSSOParamsbackend type using the existingKeyManagementRoutesenum, and refactored the settings page layout for clarity.Testing
/key/aliases,/team/daily/activity,/key/info, and/key/listType
🐛 Bug Fix