aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-07-12 12:52:20 +0000
committerGitHub <noreply@github.com>2022-07-12 14:52:20 +0200
commit0f89417d7518c44ae9dbb79e81c6db82ecb3c3bc (patch)
tree3ae502343b59a0e3695495e1ef8ee6fc306fe044
parent7c80a0b630402c35ff5177bc98e2781aef9c7dc5 (diff)
downloadgitea-0f89417d7518c44ae9dbb79e81c6db82ecb3c3bc.tar.gz
gitea-0f89417d7518c44ae9dbb79e81c6db82ecb3c3bc.zip
Add write check for creating Commit status (#20332) (#20334)
- Backport #20332 - Add write code checks for creating new commit status - Regression from #5314 - Resolves #20331
-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 7a2347650a..d06adeed0f 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -954,7 +954,7 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
}, mustAllowPulls, reqRepoReader(unit.TypeCode), context.ReferencesGitRepo(false))
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("", repo.GetAllCommits)