1
0

Improved item deletion rights check

This commit is contained in:
konrad
2018-06-12 18:49:56 +02:00
committed by kolaente
parent 1bb7187285
commit 1b3b2ccb59
3 changed files with 20 additions and 1 deletions

View File

@ -28,6 +28,10 @@ func DeleteListItemByIDtemByID(c echo.Context) error {
return c.JSON(http.StatusNotFound, models.Message{"List item does not exist."})
}
if models.IsErrNeedToBeItemOwner(err) {
return c.JSON(http.StatusForbidden, models.Message{"You need to own the list item in order to be able to delete it."})
}
return c.JSON(http.StatusInternalServerError, models.Message{"An error occured."})
}