This commit is contained in:
Timothy Jaeryang Baek
2024-11-15 03:02:08 -08:00
parent a0f1164af7
commit 147bd0717d
2 changed files with 10 additions and 5 deletions

View File

@@ -116,7 +116,7 @@ async def delete_model_by_id(id: str, user=Depends(get_verified_user)):
detail=ERROR_MESSAGES.NOT_FOUND,
)
if model.user_id != user.id:
if model.user_id != user.id and user.role != "admin":
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.UNAUTHORIZED,