diff options
author | Gusted <williamzijl7@hotmail.com> | 2021-11-25 04:17:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-25 12:17:16 +0800 |
commit | 4b4997c73e63effef932d9647ad0eb204eb39973 (patch) | |
tree | 6ace98ae05eb3fcde01707b17865d8563e75499f /modules/notification | |
parent | 4f996978887e71dc59fe2148ec768355baf684d8 (diff) | |
download | gitea-4b4997c73e63effef932d9647ad0eb204eb39973.tar.gz gitea-4b4997c73e63effef932d9647ad0eb204eb39973.zip |
Use correct user on releases (#17806)
- Use the provided `doer` instead of `rel.Publisher`. The code will also
run on edited releases and deleted ones, which isn't necessary done by
`rel.Publisher`.
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/notification')
-rw-r--r-- | modules/notification/webhook/webhook.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/notification/webhook/webhook.go b/modules/notification/webhook/webhook.go index 8fe456e1c9..bae9b78da0 100644 --- a/modules/notification/webhook/webhook.go +++ b/modules/notification/webhook/webhook.go @@ -769,12 +769,12 @@ func sendReleaseHook(doer *user_model.User, rel *models.Release, action api.Hook return } - mode, _ := models.AccessLevel(rel.Publisher, rel.Repo) + mode, _ := models.AccessLevel(doer, rel.Repo) if err := webhook_services.PrepareWebhooks(rel.Repo, webhook.HookEventRelease, &api.ReleasePayload{ Action: action, Release: convert.ToRelease(rel), Repository: convert.ToRepo(rel.Repo, mode), - Sender: convert.ToUser(rel.Publisher, nil), + Sender: convert.ToUser(doer, nil), }); err != nil { log.Error("PrepareWebhooks: %v", err) } |