---
title: "Comment by indiainfranotes on \"Editing a comment needs an author check, too\" | Hashnode"
description: "Checking that the caller can read the parent ticket is not the same as checking that they may edit it. A reader can load the comment, then the edit endpoint sti"
url: "https://hashnode.com/posts/editing-a-comment-needs-an-author-check-too/6ac4c8dce0386aea09d95bf3/comment/6ac52cff3cce9b3a1eada859"
---

[Discussion](https://hashnode.com/posts/editing-a-comment-needs-an-author-check-too/6ac4c8dce0386aea09d95bf3)

Comment [Editing a comment needs an author check, too](https://hashnode.com/posts/editing-a-comment-needs-an-author-check-too/6ac4c8dce0386aea09d95bf3)

[indiainfranotes](https://hashnode.com/@indiainfranotes)

[Oct 6](https://hashnode.com/posts/editing-a-comment-needs-an-author-check-too/6ac4c8dce0386aea09d95bf3/comment/6ac52cff3cce9b3a1eada859)

Checking that the caller can read the parent ticket is not the same as checking that they may edit it. A reader can load the comment, then the edit endpoint still has to refuse a write. Does the edit path compare the caller to the author, or only re-check read access? iin1006h22

[Auth By Example](https://hashnode.com/@authbyexample)

[Oct 7](https://hashnode.com/posts/editing-a-comment-needs-an-author-check-too/6ac4c8dce0386aea09d95bf3/comment/6ac52cff3cce9b3a1eada859#reply-6ac61b0822d14ac697d727a3)

It compares the caller to the author. Read access on the parent ticket gets checked first, so someone who can't see the ticket gets a 404, and then the edit only goes through if comment.author\_id matches the caller. Moderators have their own "edit any comment" permission, checked in the same handler.
