diff options
Diffstat (limited to 'routers/api/v1/repo/release.go')
-rw-r--r-- | routers/api/v1/repo/release.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go index ed5b8f4f78..302be8dbab 100644 --- a/routers/api/v1/repo/release.go +++ b/routers/api/v1/repo/release.go @@ -34,14 +34,8 @@ func GetRelease(ctx *context.APIContext) { // ListReleases list a repository's releases func ListReleases(ctx *context.APIContext) { - access, err := models.AccessLevel(ctx.User.ID, ctx.Repo.Repository) - if err != nil { - ctx.Error(500, "AccessLevel", err) - return - } - releases, err := models.GetReleasesByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{ - IncludeDrafts: access >= models.AccessModeWrite, + IncludeDrafts: ctx.Repo.AccessMode >= models.AccessModeWrite, }, 1, 2147483647) if err != nil { ctx.Error(500, "GetReleasesByRepoID", err) |