Skip to content

Commit 04c4028

Browse files
committed
fix some bug
1 parent fd45a03 commit 04c4028

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

routers/api/v1/api.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ func RegisterRoutes(m *macaron.Macaron) {
372372
Post(bind(api.CreateKeyOption{}), repo.CreateDeployKey)
373373
m.Combo("/:id").Get(repo.GetDeployKey).
374374
Delete(repo.DeleteDeploykey)
375-
}, reqToken())
375+
}, reqToken(), reqRepoWriter())
376376
m.Group("/issues", func() {
377377
m.Combo("").Get(repo.ListIssues).
378378
Post(reqToken(), bind(api.CreateIssueOption{}), repo.CreateIssue)
@@ -425,12 +425,12 @@ func RegisterRoutes(m *macaron.Macaron) {
425425
})
426426
m.Group("/releases", func() {
427427
m.Combo("").Get(repo.ListReleases).
428-
Post(reqToken(), bind(api.CreateReleaseOption{}), repo.CreateRelease)
428+
Post(reqToken(), reqRepoWriter(), bind(api.CreateReleaseOption{}), repo.CreateRelease)
429429
m.Combo("/:id").Get(repo.GetRelease).
430-
Patch(reqToken(), bind(api.EditReleaseOption{}), repo.EditRelease).
431-
Delete(reqToken(), repo.DeleteRelease)
430+
Patch(reqToken(), reqRepoWriter(), bind(api.EditReleaseOption{}), repo.EditRelease).
431+
Delete(reqToken(), reqRepoWriter(), repo.DeleteRelease)
432432
})
433-
m.Post("/mirror-sync", reqToken(), repo.MirrorSync)
433+
m.Post("/mirror-sync", reqToken(), reqRepoWriter(), repo.MirrorSync)
434434
m.Get("/editorconfig/:filename", context.RepoRef(), repo.GetEditorconfig)
435435
m.Group("/pulls", func() {
436436
m.Combo("").Get(bind(api.ListPullRequestsOptions{}), repo.ListPullRequests).

0 commit comments

Comments
 (0)