diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-07-12 12:51:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 14:51:06 +0200 |
commit | 3aec32ad16402c4c93c3e199f270645069c7ad37 (patch) | |
tree | 7d7fd9801ebff7a0e41ce60c4d635d7ad2331346 /routers/api/v1 | |
parent | e24c238ecc400dca713d41b3178c69475a66cb27 (diff) | |
download | gitea-3aec32ad16402c4c93c3e199f270645069c7ad37.tar.gz gitea-3aec32ad16402c4c93c3e199f270645069c7ad37.zip |
Add write check for creating Commit status (#20332)
- Add write code checks for creating new commit status
- Regression #5314
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/api/v1')
-rw-r--r-- | routers/api/v1/api.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index c93606ae88..44e0c290a0 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -1017,7 +1017,7 @@ func Routes() *web.Route { }, mustAllowPulls, reqRepoReader(unit.TypeCode), context.ReferencesGitRepo()) m.Group("/statuses", func() { m.Combo("/{sha}").Get(repo.GetCommitStatuses). - Post(reqToken(), bind(api.CreateStatusOption{}), repo.NewCommitStatus) + Post(reqToken(), reqRepoWriter(unit.TypeCode), bind(api.CreateStatusOption{}), repo.NewCommitStatus) }, reqRepoReader(unit.TypeCode)) m.Group("/commits", func() { m.Get("", context.ReferencesGitRepo(), repo.GetAllCommits) |