web: close controls for an issue's or merge request's author !545

merged merged by cmc on 2026-09-30 06:47 UTC · krz/gitbay:author-close into main

Discussion

cmc
  • issue.html: the State box (Close/Reopen issue) renders on CanEdit instead of CanWrite.
  • mr.html: "Close without merging" and the draft toggle move out of the writer-only Review/Merge block into their own State box on CanEdit (open or source_gone); Approve / Request changes / Merge stay on CanWrite.
  • CanEdit is canEditItem (author or write), the same rule as the commands' authorOrWrite. The POST routes are requireUser only, so no handler change.
  • authorclose_test.go: an author without write sees close (and draft); a non-author reader does not; the author does not get review or merge.
  • CHANGELOG entry under Unreleased.

Build, vet, and internal/httpd, internal/web, internal/control tests pass locally.

Closes #311