diff --git a/app/store/service.go b/app/store/service.go index d2ed9fb9..72a9e0fd 100644 --- a/app/store/service.go +++ b/app/store/service.go @@ -58,6 +58,10 @@ func (s *Service) Vote(locator Locator, commentID string, userID string, val boo return comment, err } + if comment.User.ID == userID { + return comment, errors.Errorf("user %s can not vote for his own comment %s", userID, commentID) + } + if comment.Votes == nil { comment.Votes = make(map[string]bool) }