mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 05:45:19 +00:00
Update models.py
This commit is contained in:
parent
d8c4dd6f79
commit
357b57e1d6
1 changed files with 39 additions and 57 deletions
|
|
@ -23,7 +23,6 @@ from open_webui.utils.access_control import has_access
|
|||
|
||||
from open_webui.config import (
|
||||
DEFAULT_ARENA_MODEL,
|
||||
ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS,
|
||||
)
|
||||
|
||||
from open_webui.env import SRC_LOG_LEVELS, GLOBAL_LOG_LEVEL
|
||||
|
|
@ -182,23 +181,6 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
|||
elif custom_model.is_active and (
|
||||
custom_model.id not in [model["id"] for model in models]
|
||||
):
|
||||
# Check access control for custom models
|
||||
should_include = False
|
||||
|
||||
if user and user.role == "admin" and ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS:
|
||||
# Admin with full workspace access
|
||||
should_include = True
|
||||
elif user and user.id == custom_model.user_id:
|
||||
# Owner always has access
|
||||
should_include = True
|
||||
elif user and has_access(user.id, "read", custom_model.access_control):
|
||||
# User has explicit read access
|
||||
should_include = True
|
||||
elif not user:
|
||||
# No user context - include for backwards compatibility
|
||||
should_include = True
|
||||
|
||||
if should_include:
|
||||
owned_by = "openai"
|
||||
pipe = None
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue