mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
build(ui): allow admin_viewer to view teams tab
Allows admin viewe role to see available teams on proxy ui
This commit is contained in:
parent
36e90e2d65
commit
cbad9e7502
5 changed files with 72 additions and 13 deletions
|
@ -766,7 +766,11 @@ async def team_info(
|
|||
detail={"message": "Malformed request. No team id passed in."},
|
||||
)
|
||||
|
||||
if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value:
|
||||
if (
|
||||
user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value
|
||||
or user_api_key_dict.user_role
|
||||
== LitellmUserRoles.PROXY_ADMIN_VIEW_ONLY.value
|
||||
):
|
||||
pass
|
||||
elif user_api_key_dict.team_id is None or (
|
||||
team_id != user_api_key_dict.team_id
|
||||
|
@ -916,7 +920,10 @@ async def list_team(
|
|||
prisma_client,
|
||||
)
|
||||
|
||||
if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:
|
||||
if (
|
||||
user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN
|
||||
and user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN_VIEW_ONLY
|
||||
):
|
||||
raise HTTPException(
|
||||
status_code=401,
|
||||
detail={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue