Skip to content

Commit

Permalink
Add write check for creating Commit status (go-gitea#20332)
Browse files Browse the repository at this point in the history
- Backport go-gitea#20332
  - Add write code checks for creating new commit status
  - Regression from go-gitea#5314
  - Resolves go-gitea#20331
  • Loading branch information
Gusted committed Jul 12, 2022
1 parent 7c80a0b commit 09f44d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 09f44d6

Please sign in to comment.