diff --git a/backend/open_webui/routers/models.py b/backend/open_webui/routers/models.py index 92afc7f2a..0cf3308f1 100644 --- a/backend/open_webui/routers/models.py +++ b/backend/open_webui/routers/models.py @@ -185,8 +185,8 @@ async def delete_model_by_id(id: str, user=Depends(get_verified_user)): if ( user.role != "admin" - or model.user_id != user.id - or not has_access(user.id, "write", model.access_control) + and model.user_id != user.id + and not has_access(user.id, "write", model.access_control) ): raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED,