fix: default invite user modal global role to least-privilege#25721
fix: default invite user modal global role to least-privilege#25721ryan-crabbe-berri merged 1 commit intomainfrom
Conversation
Pre-select "Internal User Viewer" in the Global Proxy Role dropdown on both the standalone and embedded Invite User forms so admins don't have to remember to pick a role, and the default lands on the least privileged option rather than silently posting an undefined role.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge — minimal, correct UI change with no logic or security regressions. The change is a two-line addition of No files require special attention.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/CreateUserButton.tsx | Adds initialValues={{ user_role: "internal_user_viewer" }} to both the embedded and standalone Form instances, defaulting the Global Proxy Role to least-privilege on mount and after each form.resetFields() call. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Admin opens Invite User modal] --> B{isEmbedded?}
B -- Yes --> C[Embedded Form\ninitialValues: internal_user_viewer]
B -- No --> D[Standalone Modal Form\ninitialValues: internal_user_viewer]
C --> E[Admin optionally changes role]
D --> E
E --> F[Submit form]
F --> G[userCreateCall with user_role]
G --> H[form.resetFields\nresets to internal_user_viewer]
Reviews (1): Last reviewed commit: "fix: default invite user modal global ro..." | Re-trigger Greptile
Summary
The Global Proxy Role dropdown in the Invite User modal had no default value, so admins had to remember to pick a role before submitting. If they forgot, the form posted
user_role: undefinedto/user/new.This PR pre-selects
internal_user_viewer— the least-privileged of the four roles returned by/user/available_roles— on both the standalone modal (used on the Users page) and the embedded form (used inside the Create Key flow). Defaulting to least privilege means an admin has to opt into granting more access rather than opting out.Role options available on the endpoint:
proxy_adminproxy_admin_viewerinternal_userinternal_user_viewer← new defaultcircleci: https://app.circleci.com/pipelines/github/BerriAI/litellm/73620/workflows/83c1d890-896e-46ac-93b2-8658761b0a50
Screenshots
before - default doesnt show
after - least privilege default shows

Test plan
internal_user_viewer