[Feature] UI - Access Groups: Table and Details Page#21165
[Feature] UI - Access Groups: Table and Details Page#21165yuneng-jiang merged 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile OverviewGreptile SummaryThis PR adds a full Access Groups management UI to the LiteLLM dashboard, including a list page with search/sort/pagination, a details page, and create/edit/delete modals. It also introduces a reusable The implementation follows established codebase patterns well — hooks use Issues found:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsDetailsPage.tsx | Bug: "Created by" section uses updated_by instead of created_by on line 231, displaying incorrect user attribution. |
| ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsModal/AccessGroupEditModal.tsx | Bug: Missing isNameDisabled prop — users can edit the name field, but the backend ignores access_group_name in the update request, so the change silently doesn't persist. |
| ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsPage.tsx | Main access groups list page with search, sorting, pagination, and CRUD actions. Well-structured with TanStack table integration and proper Antd bridge pattern. |
| ui/litellm-dashboard/src/app/(dashboard)/hooks/accessGroups/useAccessGroups.ts | Standard list query hook following established patterns. Uses proper auth gating, query key factory, and error handling. |
| ui/litellm-dashboard/src/app/(dashboard)/hooks/accessGroups/useEditAccessGroup.ts | Edit mutation hook includes access_group_name in AccessGroupUpdateParams, but the backend does not accept this field. Sending it is harmless but misleading. |
| ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsModal/AccessGroupBaseForm.tsx | Shared form component with tabbed layout for group info, models, MCP servers, and agents. Has the isNameDisabled prop designed for edit mode but not currently utilized by the edit modal. |
| ui/litellm-dashboard/src/components/leftnav.tsx | Adds "Access Groups" nav item with NewBadge under admin roles. Removes NewBadge from Logs. Clean changes. |
| ui/litellm-dashboard/src/app/page.tsx | Adds routing for the "access-groups" page to render AccessGroupsPage. Follows existing conditional rendering pattern. |
Flowchart
flowchart TD
subgraph LeftNav
LN[Left Nav] -->|click 'Access Groups'| AG_PAGE
end
subgraph AccessGroupsPage
AG_PAGE[AccessGroupsPage] -->|useAccessGroups| FETCH_LIST["GET /v1/access_group"]
AG_PAGE -->|click group ID| DETAIL[AccessGroupDetail]
AG_PAGE -->|click 'Create'| CREATE_MODAL[AccessGroupCreateModal]
AG_PAGE -->|click 'Delete'| DELETE_MODAL[DeleteResourceModal]
end
subgraph AccessGroupDetail
DETAIL -->|useAccessGroupDetails| FETCH_DETAIL["GET /v1/access_group/:id"]
DETAIL -->|click 'Edit'| EDIT_MODAL[AccessGroupEditModal]
end
subgraph Modals
CREATE_MODAL -->|AccessGroupBaseForm| BASE_FORM[AccessGroupBaseForm]
EDIT_MODAL -->|AccessGroupBaseForm| BASE_FORM
CREATE_MODAL -->|useCreateAccessGroup| POST_CREATE["POST /v1/access_group"]
EDIT_MODAL -->|useEditAccessGroup| PUT_EDIT["PUT /v1/access_group/:id"]
DELETE_MODAL -->|useDeleteAccessGroup| DEL["DELETE /v1/access_group/:id"]
end
subgraph CacheInvalidation
POST_CREATE -->|invalidate| CACHE["React Query Cache"]
PUT_EDIT -->|invalidate| CACHE
DEL -->|invalidate| CACHE
CACHE -->|refetch| FETCH_LIST
end
Last reviewed commit: ca2ce4a
| <Descriptions.Item label="Created"> | ||
| {new Date(accessGroup.created_at).toLocaleString()} | ||
| {accessGroup.created_by && ( | ||
| <Text> | ||
| {"by"} | ||
| <DefaultProxyAdminTag userId={accessGroup.updated_by} /> | ||
| </Text> | ||
| )} | ||
| </Descriptions.Item> |
There was a problem hiding this comment.
Wrong user ID for "Created by"
The "Created" description item checks accessGroup.created_by on line 228 to decide whether to show the "by" label, but then passes accessGroup.updated_by to DefaultProxyAdminTag on line 231. This means the "Created by" field displays the updater's identity instead of the creator's.
| <Descriptions.Item label="Created"> | |
| {new Date(accessGroup.created_at).toLocaleString()} | |
| {accessGroup.created_by && ( | |
| <Text> | |
| {"by"} | |
| <DefaultProxyAdminTag userId={accessGroup.updated_by} /> | |
| </Text> | |
| )} | |
| </Descriptions.Item> | |
| <Descriptions.Item label="Created"> | |
| {new Date(accessGroup.created_at).toLocaleString()} | |
| {accessGroup.created_by && ( | |
| <Text> | |
| {"by"} | |
| <DefaultProxyAdminTag userId={accessGroup.created_by} /> | |
| </Text> | |
| )} | |
| </Descriptions.Item> |
| confirmLoading={editMutation.isPending} | ||
| destroyOnClose | ||
| > | ||
| <AccessGroupBaseForm form={form} /> |
There was a problem hiding this comment.
Name field editable but backend ignores it
The edit modal renders AccessGroupBaseForm without passing isNameDisabled={true}. The base form has this prop specifically for this purpose, but it's not used here. The backend AccessGroupUpdateRequest does not include access_group_name — the field will be silently ignored on the server. This gives users the misleading impression they can rename access groups when the change won't actually persist.
| <AccessGroupBaseForm form={form} /> | |
| <AccessGroupBaseForm form={form} isNameDisabled /> |
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
✅ Test
Changes
Adds an Access Groups management UI to the LiteLLM dashboard. Admins can list, create, edit, and delete access groups from a new "Access Groups" page in the left nav. The UI includes a list page with search and sorting, a details page for each group, and create/edit modals. Introduces
DefaultProxyAdminTagto display "Default Proxy Admin" when the user ID isdefault_user_id. Moves the New badge from Logs to Access Groups. Adds unit tests forAccessGroupsPage,AccessGroupsDetailsPage, anduseAccessGroups.Screenshots