From 6906a0bd2691cd6128cf4fc6b5dca5c3777e6aea Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 17 Nov 2024 14:03:51 -0800 Subject: [PATCH] fix: access control --- backend/open_webui/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index f639b932c..37c94247a 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1147,7 +1147,7 @@ async def generate_chat_completions( # Check if user has access to the model if user.role == "user": model_info = Models.get_model_by_id(model_id) - if not ( + if model_info and not ( user.id == model_info.user_id or has_access( user.id, type="read", access_control=model_info.access_control