Skip to content

Commit 0f89417

Browse files
author
Gusted
authored
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
1 parent 7c80a0b commit 0f89417

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: routers/api/v1/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
954954
}, mustAllowPulls, reqRepoReader(unit.TypeCode), context.ReferencesGitRepo(false))
955955
m.Group("/statuses", func() {
956956
m.Combo("/{sha}").Get(repo.GetCommitStatuses).
957-
Post(reqToken(), bind(api.CreateStatusOption{}), repo.NewCommitStatus)
957+
Post(reqToken(), reqRepoWriter(unit.TypeCode), bind(api.CreateStatusOption{}), repo.NewCommitStatus)
958958
}, reqRepoReader(unit.TypeCode))
959959
m.Group("/commits", func() {
960960
m.Get("", repo.GetAllCommits)

0 commit comments

Comments
 (0)