fix/refac: workspace shared model list

This commit is contained in:
Timothy Jaeryang Baek
2025-11-25 06:32:27 -05:00
parent f3547568e4
commit 69722ba973
2 changed files with 35 additions and 3 deletions
+5
View File
@@ -5,6 +5,7 @@ import json
import asyncio
import logging
from open_webui.models.groups import Groups
from open_webui.models.models import (
ModelForm,
ModelModel,
@@ -78,6 +79,10 @@ async def get_models(
filter["direction"] = direction
if not user.role == "admin" or not BYPASS_ADMIN_ACCESS_CONTROL:
groups = Groups.get_groups_by_member_id(user.id)
if groups:
filter["group_ids"] = [group.id for group in groups]
filter["user_id"] = user.id
return Models.search_models(user.id, filter=filter, skip=skip, limit=limit)