From 21eaeb84183f7640aa8ddd8f85fc105ca355e151 Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Thu, 5 Mar 2020 22:42:20 -0600 Subject: [PATCH] Issue writers perms can modify issues (#10623) (#10626) Signed-off-by: jolheiser --- routers/repo/pull.go | 2 ++ templates/repo/issue/view_content/context_menu.tmpl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 1e2d60d72..1960acdaa 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -596,6 +596,8 @@ func ViewPullFiles(ctx *context.Context) { return } getBranchData(ctx, issue) + ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.User.ID) + ctx.Data["IsIssueWriter"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) ctx.HTML(200, tplPullFiles) } diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl index 468e004c9..8a96f27ff 100644 --- a/templates/repo/issue/view_content/context_menu.tmpl +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -10,7 +10,7 @@
{{.ctx.i18n.Tr "repo.issues.context.copy_link"}}
{{end}}
{{.ctx.i18n.Tr "repo.issues.context.quote_reply"}}
- {{if or .ctx.Permission.IsAdmin (eq .item.Poster.ID .ctx.SignedUserID)}} + {{if or .ctx.Permission.IsAdmin .ctx.IsIssuePoster .ctx.IsIssueWriter}}
{{.ctx.i18n.Tr "repo.issues.context.edit"}}
{{if .delete}}