backport #36833
Make `handlePullRequestAutoMerge` correctly check the permissions of the
merging user against pr.BaseRepo.
Co-authored-by: Michael Hoang <10492681+Enzime@users.noreply.github.com>
Co-authored-by: Michael Hoang <enzime@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>