diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 29bd59c7a..e15f548a3 100644 --- a/routers/web/repo/projects.go +++ b/routers/web/repo/projects.go @@ -113,7 +113,7 @@ func Projects(ctx *context.Context) { pager.AddParam(ctx, "state", "State") ctx.Data["Page"] = pager - ctx.Data["CanWriteProjects"] = true + ctx.Data["CanWriteProjects"] = ctx.Repo.Permission.CanWrite(unit.TypeProjects) ctx.Data["IsShowClosed"] = isShowClosed ctx.Data["IsProjectsPage"] = true ctx.Data["SortType"] = sortType diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl index 489189ec4..4a21c0fd2 100644 --- a/templates/projects/list.tmpl +++ b/templates/projects/list.tmpl @@ -51,7 +51,7 @@ {{JsPrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} - {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} + {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}} {{if .IsClosed}} @@ -59,7 +59,7 @@ {{else}} {{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}} {{end}} - {{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}} + {{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}
{{end}} {{if .Description}} @@ -75,7 +75,7 @@ -{{if or .CanWriteIssues .CanWritePulls}} +{{if $.CanWriteProjects}}