Browse Source

fix some bug

Lunny Xiao 1 year ago
parent
commit
04c4028aea
1 changed files with 5 additions and 5 deletions
  1. 5 5
      routers/api/v1/api.go

+ 5 - 5
routers/api/v1/api.go

@@ -372,7 +372,7 @@ func RegisterRoutes(m *macaron.Macaron) {
372 372
 						Post(bind(api.CreateKeyOption{}), repo.CreateDeployKey)
373 373
 					m.Combo("/:id").Get(repo.GetDeployKey).
374 374
 						Delete(repo.DeleteDeploykey)
375
-				}, reqToken())
375
+				}, reqToken(), reqRepoWriter())
376 376
 				m.Group("/issues", func() {
377 377
 					m.Combo("").Get(repo.ListIssues).
378 378
 						Post(reqToken(), bind(api.CreateIssueOption{}), repo.CreateIssue)
@@ -425,12 +425,12 @@ func RegisterRoutes(m *macaron.Macaron) {
425 425
 				})
426 426
 				m.Group("/releases", func() {
427 427
 					m.Combo("").Get(repo.ListReleases).
428
-						Post(reqToken(), bind(api.CreateReleaseOption{}), repo.CreateRelease)
428
+						Post(reqToken(), reqRepoWriter(), bind(api.CreateReleaseOption{}), repo.CreateRelease)
429 429
 					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)
432 432
 				})
433
-				m.Post("/mirror-sync", reqToken(), repo.MirrorSync)
433
+				m.Post("/mirror-sync", reqToken(), reqRepoWriter(), repo.MirrorSync)
434 434
 				m.Get("/editorconfig/:filename", context.RepoRef(), repo.GetEditorconfig)
435 435
 				m.Group("/pulls", func() {
436 436
 					m.Combo("").Get(bind(api.ListPullRequestsOptions{}), repo.ListPullRequests).