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
- Add write code checks for creating new commit status
- Regression go-gitea#5314

Co-authored-by: zeripath <art27@cantab.net>
  • Loading branch information
2 people authored and Sysoev, Vladimir committed Aug 10, 2022
1 parent d9d48d9 commit 4856832
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 @@ -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)
Expand Down

0 comments on commit 4856832

Please sign in to comment.