Allow Edit for admin in circle

This commit is contained in:
Mo Tarbin 2025-02-07 00:38:09 -05:00
parent bafc519150
commit 3919429f77
4 changed files with 16 additions and 5 deletions

View file

@ -427,7 +427,7 @@ func (h *Handler) editChore(c *gin.Context) {
})
return
}
if currentUser.ID != oldChore.CreatedBy {
if !oldChore.CanEdit(currentUser.ID, circleUsers) {
c.JSON(403, gin.H{
"error": "You are not allowed to edit this chore",
})