mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Litellm stable UI 02 17 2025 p1 (#8599)
* fix(key_management_endpoints.py): initial commit with logic to get all keys for teams user is an admin for * fix(key_managements_endpoints.py): return all keys for teams user is an admin for * fix(key_management_endpoints.py): add query param to ensure user opts into seeing all team keys (not just their own) * fix(regenerate_key_modal.tsx): fix key regenerate * fix(proxy_server.py): fix model metrics check on none api base * test(test_key_generate_prisma.py): remove redundant test * test(test_proxy_utils.py): add unit test covering new management endpoint helper util * fix: fix test * test(test_proxy_server.py): fix test
This commit is contained in:
parent
d0413ec96b
commit
51cb3c84e3
10 changed files with 277 additions and 121 deletions
14
litellm/proxy/management_endpoints/common_utils.py
Normal file
14
litellm/proxy/management_endpoints/common_utils.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from litellm.proxy._types import LiteLLM_TeamTable, UserAPIKeyAuth
|
||||
|
||||
|
||||
def _is_user_team_admin(
|
||||
user_api_key_dict: UserAPIKeyAuth, team_obj: LiteLLM_TeamTable
|
||||
) -> bool:
|
||||
for member in team_obj.members_with_roles:
|
||||
if (
|
||||
member.user_id is not None and member.user_id == user_api_key_dict.user_id
|
||||
) and member.role == "admin":
|
||||
|
||||
return True
|
||||
|
||||
return False
|
Loading…
Add table
Add a link
Reference in a new issue