From 24a8d54bfb908a2371cb808a5243b3290dd0664a Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Sun, 28 Nov 2021 05:13:13 +0100 Subject: [PATCH] Disable ref selection dropdown if you don't have permissions to use it (#17837) Co-authored-by: Lauris BH Co-authored-by: Lunny Xiao --- routers/web/repo/issue.go | 2 -- templates/repo/issue/branch_selector_field.tmpl | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 1ff126c7d..2e0118e03 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -955,7 +955,6 @@ func NewIssuePost(ctx *context.Context) { ctx.Data["NewIssueChooseTemplate"] = len(ctx.IssueTemplatesFromDefaultBranch()) > 0 ctx.Data["RequireHighlightJS"] = true ctx.Data["RequireSimpleMDE"] = true - ctx.Data["ReadOnly"] = false ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled upload.AddUploadContext(ctx, "comment") @@ -1630,7 +1629,6 @@ func ViewIssue(ctx *context.Context) { ctx.Data["Participants"] = participants ctx.Data["NumParticipants"] = len(participants) ctx.Data["Issue"] = issue - ctx.Data["ReadOnly"] = false ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + url.QueryEscape(ctx.Data["Link"].(string)) ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.User.ID) ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl index e115b4a3f..cb7d37fb9 100644 --- a/templates/repo/issue/branch_selector_field.tmpl +++ b/templates/repo/issue/branch_selector_field.tmpl @@ -5,10 +5,10 @@ {{$.CsrfTokenHtml}} -