Procházet zdrojové kódy

fix: admin folder deletion issue

Timothy Jaeryang Baek před 5 měsíci
rodič
revize
0644abe402
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      backend/open_webui/routers/folders.py

+ 2 - 1
backend/open_webui/routers/folders.py

@@ -236,7 +236,8 @@ async def delete_folder_by_id(
     chat_delete_permission = has_permission(
         user.id, "chat.delete", request.app.state.config.USER_PERMISSIONS
     )
-    if not chat_delete_permission:
+
+    if user.role != "admin" and not chat_delete_permission:
         raise HTTPException(
             status_code=status.HTTP_403_FORBIDDEN,
             detail=ERROR_MESSAGES.ACCESS_PROHIBITED,