From f758bf74c2e308a6af7613a376e7cd28b6a3f558 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 11 Aug 2025 23:39:01 +0200 Subject: [PATCH] Update main.py --- backend/open_webui/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 076d4c486d..c2cd587c8e 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -375,6 +375,7 @@ from open_webui.config import ( RESPONSE_WATERMARK, # Admin ENABLE_ADMIN_CHAT_ACCESS, + ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS, ENABLE_ADMIN_EXPORT, # Tasks TASK_MODEL, @@ -1321,7 +1322,7 @@ async def get_models( ) # Filter out models that the user does not have access to - if user.role == "user" and not BYPASS_MODEL_ACCESS_CONTROL: + if (user.role == "user" or (user.role == "admin" and not ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS)) and not BYPASS_MODEL_ACCESS_CONTROL: models = get_filtered_models(models, user) log.debug(