diff --git a/services/context/repo.go b/services/context/repo.go index 9cdef69a15..88a0d7d61b 100644 --- a/services/context/repo.go +++ b/services/context/repo.go @@ -612,6 +612,7 @@ func repoAssignmentPrepareTemplateData(ctx *Context, data *repoAssignmentPrepare }) ctx.Data["NumLicensePackages"] = numLicensePackages ctx.Data["EnableLicenses"] = numLicensePackages > 0 + ctx.Data["IsRepoAdmin"] = ctx.Repo.Permission.IsAdmin() ctx.Data["Title"] = repo.Owner.Name + "/" + repo.Name ctx.Data["PageTitleCommon"] = repo.Name + " - " + setting.AppName diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index cb7d95abce..7a58c53a90 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -128,7 +128,7 @@ {{end}} - {{if or .EnableLicenses (.Permission.IsAdmin)}} + {{if or .EnableLicenses .IsRepoAdmin}} {{svg "octicon-key"}} {{ctx.Locale.Tr "repo.licenses"}} {{if .NumLicensePackages}}