MCP: edit_comment and delete_comment tools
Lint / JS (eslint) (push) Successful in 14s
Lint / PHP (phpcs PSR-12) (push) Successful in 35s
Lint / PHP requirements (version + extensions) (push) Successful in 34s
Lint / Deploy (push) Skipped
Lint / Notify on failure (push) Skipped
Lint / PHP (phpcs PSR-12) (pull_request) Successful in 1m0s
Security / PHP Security (semgrep) (push) Successful in 2m44s
Lint / PHP requirements (version + extensions) (pull_request) Successful in 1m9s
Lint / JS (eslint) (pull_request) Successful in 14s
Lint / Deploy (pull_request) Skipped
Lint / Notify on failure (pull_request) Skipped
Security / PHP Security (semgrep) (pull_request) Successful in 1m44s

Two new tickets:write tools, on the same code path as the web UI's comment
edit/delete. The access check, owner-or-admin rule and audit entry moved
out of api/update_comment.php and api/delete_comment.php into
CommentService::updateComment/deleteComment (as add_comment did in #111),
and both endpoints now call it; their responses and status codes are
unchanged apart from extra ticket_id/replies_removed fields.

- edit_comment: replace a comment's text (own comments; admins any).
- delete_comment: delete a comment; replies go with it
  (fk_parent_comment ON DELETE CASCADE), so the result and the audit
  entry report replies_removed.
- A comment on a ticket the user can't see reads as "Comment N not
  found", like a missing one, so restricted tickets stay hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-25 17:19:54 -05:00
1 parent bdc6028572
commit 450b2fac3b
6 files changed
+209 -102

No files matched your search

+3 -1
View File
@@ -132,6 +132,8 @@ claude mcp login tinker # add --no-browser on a headless machine, the
| `find_similar_tickets` | `tickets:read` | Open tickets with similar titles, by title text or an existing ticket (same finder as the ticket page's possible-duplicates list) |
| `create_ticket` | `tickets:write` | Create a ticket (title, description, priority, category, type, visibility, assignee) |
| `add_comment` | `tickets:write` | Comment (markdown, @mentions, replies) |
| `edit_comment` | `tickets:write` | Replace a comment's text (your own comments; admins any) |
| `delete_comment` | `tickets:write` | Delete a comment and its replies (your own comments; admins any); reports `replies_removed` |
| `update_status` | `tickets:write` | Workflow-validated status change; `comment` required when the transition requires one |
| `assign_ticket` | `tickets:write` | Assign / unassign (admin, creator, or current assignee only) |
| `link_tickets` | `tickets:write` | Add a `blocks` / `blocked_by` / `relates_to` / `duplicates` link ("A duplicates B" = A is the duplicate; links only, never closes anything) |
@@ -448,7 +450,7 @@ tinker_tickets/
│ └── cleanup_orphan_uploads.php # Delete orphaned upload files past grace period (cron)
├── services/
│ ├── AssignmentService.php # Assign/unassign (shared by assign_ticket.php + MCP)
│ ├── CommentService.php # Add comment + mentions/notifications (shared by add_comment.php + MCP)
│ ├── CommentService.php # Add/edit/delete comments (shared by the comment endpoints + MCP)
│ ├── DependencyService.php # List/add/remove ticket links (shared by ticket_dependencies.php + MCP)
│ ├── SimilarTicketService.php # Similar-title finder (shared by check_duplicates.php + MCP)
│ └── TicketCreationService.php # Create ticket (shared by TicketController + MCP)