diff options
author | Unknwon <u@gogs.io> | 2017-03-18 16:44:40 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-18 16:44:40 -0400 |
commit | 55a5ad5cdcbe6906f863d0b7f27d1ee500720416 (patch) | |
tree | 1d8b2204ff8ca9d9d2bb0938ad839a3356fb54a7 /routers/api/v1 | |
parent | b3c4a39208331fd3798923bde01bf556b9e90c0d (diff) |
api/repo: fix incorrect permission values (#4309)
Diffstat (limited to 'routers/api/v1')
-rw-r--r-- | routers/api/v1/api.go | 2 | ||||
-rw-r--r-- | routers/api/v1/repo/repo.go | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 49c1ee59..6a9c5441 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -242,7 +242,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/repos", func() { m.Post("/migrate", bind(form.MigrateRepo{}), repo.Migrate) - m.Combo("/:username/:reponame").Get(repo.Get). + m.Combo("/:username/:reponame", repoAssignment()).Get(repo.Get). Delete(repo.Delete) m.Group("/:username/:reponame", func() { diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index a491e7ce..7ff47a2d 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -309,7 +309,11 @@ func Get(ctx *context.APIContext) { return } - ctx.JSON(200, repo.APIFormat(&api.Permission{true, true, true})) + ctx.JSON(200, repo.APIFormat(&api.Permission{ + Admin: ctx.Repo.IsAdmin(), + Push: ctx.Repo.IsWriter(), + Pull: true, + })) } // https://github.com/gogits/go-gogs-client/wiki/Repositories#delete |