summaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-07-12 12:51:06 +0000
committerGitHub <noreply@github.com>2022-07-12 14:51:06 +0200
commit3aec32ad16402c4c93c3e199f270645069c7ad37 (patch)
tree7d7fd9801ebff7a0e41ce60c4d635d7ad2331346 /routers/api/v1
parente24c238ecc400dca713d41b3178c69475a66cb27 (diff)
downloadgitea-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.go2
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)