From a8f2919e9ec3bb9704edcb9327d8f972fb5f4f2d Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 29 Jan 2025 21:31:18 -0800 Subject: [PATCH] fix: #9003 --- backend/open_webui/routers/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/routers/models.py b/backend/open_webui/routers/models.py index a45814d32..92afc7f2a 100644 --- a/backend/open_webui/routers/models.py +++ b/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,