mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
fix: temp chat not working
This commit is contained in:
@@ -1286,7 +1286,9 @@ async def get_models(
|
||||
if (
|
||||
(user.role == "admin" and ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS)
|
||||
or user.id == model_info.user_id
|
||||
or has_access(user.id, type="read", access_control=model_info.access_control)
|
||||
or has_access(
|
||||
user.id, type="read", access_control=model_info.access_control
|
||||
)
|
||||
):
|
||||
filtered_models.append(model)
|
||||
|
||||
@@ -1328,7 +1330,10 @@ async def get_models(
|
||||
)
|
||||
|
||||
# Filter out models that the user does not have access to
|
||||
if (user.role == "user" or (user.role == "admin" and not ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS)) 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(
|
||||
@@ -1453,6 +1458,7 @@ async def chat_completion(
|
||||
}
|
||||
|
||||
if metadata.get("chat_id") and (user and user.role != "admin"):
|
||||
if metadata["chat_id"] != "local":
|
||||
chat = Chats.get_chat_by_id_and_user_id(metadata["chat_id"], user.id)
|
||||
if chat is None:
|
||||
raise HTTPException(
|
||||
|
||||
Reference in New Issue
Block a user