1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Fix repo API bug (#2133)

Don't require token when not necessary
This commit is contained in:
Ethan Koenig
2017-07-11 21:23:41 -04:00
committed by Kim "BKC" Carlbäcker
parent da89afda58
commit 93a1de4842
9 changed files with 132 additions and 54 deletions

View File

@@ -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