summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/fork.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-07-11 21:23:41 -0400
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-07-12 03:23:41 +0200
commit93a1de48428c2f89502cf6bba80f3976c6f5839f (patch)
tree8d08276df62513a32f0c0573b3e388bb823454ef /routers/api/v1/repo/fork.go
parentda89afda58e18700ee49f955de3f33fdc591c239 (diff)
downloadgitea-93a1de48428c2f89502cf6bba80f3976c6f5839f.tar.gz
gitea-93a1de48428c2f89502cf6bba80f3976c6f5839f.zip
Fix repo API bug (#2133)
Don't require token when not necessary
Diffstat (limited to 'routers/api/v1/repo/fork.go')
-rw-r--r--routers/api/v1/repo/fork.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go
index 44b79a6fef..25464dbd78 100644
--- a/routers/api/v1/repo/fork.go
+++ b/routers/api/v1/repo/fork.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
+ "code.gitea.io/gitea/routers/api/v1/utils"
)
// ListForks list a repository's forks
@@ -29,7 +30,7 @@ func ListForks(ctx *context.APIContext) {
}
apiForks := make([]*api.Repository, len(forks))
for i, fork := range forks {
- access, err := models.AccessLevel(ctx.User.ID, fork)
+ access, err := models.AccessLevel(utils.UserID(ctx), fork)
if err != nil {
ctx.Error(500, "AccessLevel", err)
return