Files
Gitea/tests
GiteabotandLunny Xiao f9d31d2f11 fix(api): lock and unlock issues as the signed-in user, not the repository owner (#40291) (#40298)
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>
2026-11-10 15:55:38 +00:00
..