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.