mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-11 20:57:35 +00:00
Backport #40291 by @lunny `PUT/DELETE /repos/{owner}/{repo}/issues/{index}/lock` passed `ctx.ContextUser` as the doer of `LockIssue` / `UnlockIssue`. In the repo routes that is the owner of the repository, so on a repository of an organization the lock and unlock timeline comments were created by the organization instead of the user who did it. The web handler already uses the signed-in user; this uses `ctx.Doer` as well. Adds a subtest `DoerOnOrganizationRepo` to the existing `TestAPILockIssue`: a member of an organization locks and unlocks an issue of an organization repository, and the comments must be posted by that member. Found while testing audit logging of the issue lock events downstream. _Authored by Codet (Claude)._ Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>