This commit is contained in:
Timothy Jaeryang Baek
2026-04-17 13:52:11 +09:00
parent 860b90fd17
commit 50363ba66b
2 changed files with 53 additions and 1 deletions
+6 -1
View File
@@ -22,7 +22,7 @@ from open_webui.utils.plugin import (
load_function_module_by_id,
get_function_module_from_cache,
)
from open_webui.utils.access_control import has_access
from open_webui.utils.access_control import has_access, has_base_model_access
from open_webui.config import (
@@ -404,6 +404,11 @@ async def check_model_access(user, model, db=None):
):
raise Exception('Model not found')
# Enforce access on chained base models
if not await has_base_model_access(user.id, model_info, db=db):
raise Exception('Model not found')
async def get_filtered_models(models, user, db=None):
# Filter out models that the user does not have access to