From 2cfccb1cef2c4cfc978c0f96aa1db540ec9afbff Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 23 Nov 2026 15:40:04 +0100 Subject: [PATCH] fix: users see the default image for a router model shared with them (#34796) A router model with its own profile image showed the default logo to every user it was shared with or made public for, and only admins saw the uploaded image. The image now follows the same access as the router model itself, so anyone who can see and chat with it in the model selector also sees its image, and users it is not shared with still get the default logo. Fixes #34793 --- backend/open_webui/routers/models.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/open_webui/routers/models.py b/backend/open_webui/routers/models.py index fb3cedd14e..7ec1b0a0dd 100644 --- a/backend/open_webui/routers/models.py +++ b/backend/open_webui/routers/models.py @@ -47,7 +47,6 @@ from open_webui.models.models import ( from open_webui.storage.provider import Storage from open_webui.utils.access_control import ( filter_allowed_access_grants, - has_access, has_permission, validate_access_grants, ) @@ -979,6 +978,8 @@ async def get_model_profile_image( # First, check the database for regular models model_meta = await Models.get_model_meta_by_id(id, db=db) + # As in the model list, a model without a row is visible to admins only. + read_access = bypass_access_control or (not model_meta and user.role == 'admin') if model_meta: meta, model_user_id, model_updated_at = model_meta # Denied callers get the default image rather than an error, so model ids stay unprobeable. @@ -993,6 +994,7 @@ async def get_model_profile_image( db=db, ) ): + read_access = True profile_image_url = (meta or {}).get('profile_image_url') updated_at = model_updated_at @@ -1002,12 +1004,7 @@ async def get_model_profile_image( for router_model in router_models: if router_model.get('id') == id: router_meta = router_model.get('meta', {}) - access_grants = router_meta.get('access_grants', []) - if ( - bypass_access_control - or (not access_grants and user.role == 'admin') - or await has_access(user.id, permission='read', access_grants=access_grants, db=db) - ): + if read_access: profile_image_url = router_meta.get('profile_image_url') break