浏览代码

fix: #9003

Timothy Jaeryang Baek 3 月之前
父节点
当前提交
a8f2919e9e
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      backend/open_webui/routers/models.py

+ 4 - 4
backend/open_webui/routers/models.py

@@ -184,10 +184,10 @@ async def delete_model_by_id(id: str, user=Depends(get_verified_user)):
         )
 
     if (
-            user.role == "admin"
-            or model.user_id == user.id
-            or has_access(user.id, "write", model.access_control)
-        ):
+        user.role != "admin"
+        or model.user_id != user.id
+        or not has_access(user.id, "write", model.access_control)
+    ):
         raise HTTPException(
             status_code=status.HTTP_401_UNAUTHORIZED,
             detail=ERROR_MESSAGES.UNAUTHORIZED,