diff --git a/routers/repo/milestone.go b/routers/repo/milestone.go index 6c3ad11f1f68..632c792c434e 100644 --- a/routers/repo/milestone.go +++ b/routers/repo/milestone.go @@ -260,5 +260,13 @@ func MilestoneIssuesAndPulls(ctx *context.Context) { issues(ctx, milestoneID, util.OptionalBoolNone) + perm, err := models.GetUserRepoPermission(ctx.Repo.Repository, ctx.User) + if err != nil { + ctx.ServerError("GetUserRepoPermission", err) + return + } + ctx.Data["CanWriteIssues"] = perm.CanWriteIssuesOrPulls(false) + ctx.Data["CanWritePulls"] = perm.CanWriteIssuesOrPulls(true) + ctx.HTML(200, tplMilestoneIssues) } diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 1e98d3216af6..5f55d6cf9de9 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -635,7 +635,7 @@ func RegisterRoutes(m *macaron.Macaron) { }, context.RepoMustNotBeArchived(), reqRepoIssuesOrPullsWriter, context.RepoRef()) m.Group("/milestone", func() { m.Get("/:id", repo.MilestoneIssuesAndPulls) - }, reqRepoIssuesOrPullsWriter, context.RepoRef()) + }, reqRepoIssuesOrPullsReader, context.RepoRef()) m.Combo("/compare/*", context.RepoMustNotBeArchived(), reqRepoCodeReader, reqRepoPullsReader, repo.MustAllowPulls, repo.SetEditorconfigIfExists). Get(repo.SetDiffViewStyle, repo.CompareAndPullRequest). Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost) diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 758b64f27e70..deed251cda5f 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -44,7 +44,7 @@
@@ -146,7 +146,7 @@ @@ -111,11 +113,17 @@ -