diff options
Diffstat (limited to 'routers/repo/branch.go')
-rw-r--r-- | routers/repo/branch.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go index 7b1e2a8bbe..295aeaa24b 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -1,4 +1,5 @@ // Copyright 2014 The Gogs Authors. All rights reserved. +// Copyright 2018 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. @@ -33,7 +34,7 @@ func Branches(ctx *context.Context) { ctx.Data["Title"] = "Branches" ctx.Data["IsRepoToolbarBranches"] = true ctx.Data["DefaultBranch"] = ctx.Repo.Repository.DefaultBranch - ctx.Data["IsWriter"] = ctx.Repo.IsWriter() + ctx.Data["IsWriter"] = ctx.Repo.CanWrite(models.UnitTypeCode) ctx.Data["IsMirror"] = ctx.Repo.Repository.IsMirror ctx.Data["PageIsViewCode"] = true ctx.Data["PageIsBranches"] = true @@ -161,7 +162,7 @@ func loadBranches(ctx *context.Context) []*Branch { } } - if ctx.Repo.IsWriter() { + if ctx.Repo.CanWrite(models.UnitTypeCode) { deletedBranches, err := getDeletedBranches(ctx) if err != nil { ctx.ServerError("getDeletedBranches", err) |