summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/repo.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 178f1005e5..edd6a72637 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -293,7 +293,10 @@ func GetByID(ctx *context.APIContext) {
access, err := models.AccessLevel(ctx.User.ID, repo)
if err != nil {
- ctx.Error(500, "GetRepositoryByID", err)
+ ctx.Error(500, "AccessLevel", err)
+ return
+ } else if access < models.AccessModeRead {
+ ctx.Status(404)
return
}
ctx.JSON(200, repo.APIFormat(access))