From 8d539db108dc55cca303e8f2c6757243e7dfaa1e Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Thu, 5 Mar 2026 17:36:46 -0800 Subject: [PATCH] Fix admin viewer unable to see all organizations The /organization/list endpoint only checked for PROXY_ADMIN role, causing PROXY_ADMIN_VIEW_ONLY users to fall into the else branch which restricts results to orgs the user is a member of. Use the existing _user_has_admin_view() helper to include both roles. --- litellm/proxy/management_endpoints/organization_endpoints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/management_endpoints/organization_endpoints.py b/litellm/proxy/management_endpoints/organization_endpoints.py index 1c19c4ef31..103b2efcdd 100644 --- a/litellm/proxy/management_endpoints/organization_endpoints.py +++ b/litellm/proxy/management_endpoints/organization_endpoints.py @@ -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},