aboutsummaryrefslogtreecommitdiff
path: root/routers/api/v1/repo/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-18 16:44:40 -0400
committerUnknwon <u@gogs.io>2017-03-18 16:44:40 -0400
commit55a5ad5cdcbe6906f863d0b7f27d1ee500720416 (patch)
tree1d8b2204ff8ca9d9d2bb0938ad839a3356fb54a7 /routers/api/v1/repo/repo.go
parentb3c4a39208331fd3798923bde01bf556b9e90c0d (diff)
api/repo: fix incorrect permission values (#4309)
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r--routers/api/v1/repo/repo.go6
1 files changed, 5 insertions, 1 deletions
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