Timothy Jaeryang Baek 3 тижнів тому
батько
коміт
cdb4904999
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      backend/open_webui/routers/chats.py

+ 6 - 1
backend/open_webui/routers/chats.py

@@ -579,7 +579,12 @@ async def clone_chat_by_id(
 
 @router.post("/{id}/clone/shared", response_model=Optional[ChatResponse])
 async def clone_shared_chat_by_id(id: str, user=Depends(get_verified_user)):
-    chat = Chats.get_chat_by_share_id(id)
+
+    if user.role == "admin":
+        chat = Chats.get_chat_by_id(id)
+    else:
+        chat = Chats.get_chat_by_share_id(id)
+
     if chat:
         updated_chat = {
             **chat.chat,