Merge pull request #22940 from BerriAI/litellm_fix_admin_viewer_org_list

Fix admin viewer unable to see all organizations
This commit is contained in:
ryan-crabbe 2026-03-05 17:49:57 -08:00 committed by GitHub
commit bc23c08d03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -649,8 +649,8 @@ async def list_organization(
"mode": "insensitive", # Case-insensitive search
}
# if proxy admin - get all orgs (with optional filters)
if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN:
# if proxy admin or admin viewer - get all orgs (with optional filters)
if _user_has_admin_view(user_api_key_dict):
response = await prisma_client.db.litellm_organizationtable.find_many(
where=where_conditions if where_conditions else None,
include={"litellm_budget_table": True, "members": True, "teams": True},