summaryrefslogtreecommitdiffstats
path: root/routers/repo/milestone.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-16 22:18:30 +0800
committerAntoine GIRARD <sapk@users.noreply.github.com>2020-01-16 15:18:30 +0100
commitdbd89acf980d7ab9f28cdcd33657a9699e65f52d (patch)
tree8923de7bbe25d943283b583f85a3441240f27a37 /routers/repo/milestone.go
parentf740943df4fab9c50eb44261569eb4366447c93e (diff)
downloadgitea-dbd89acf980d7ab9f28cdcd33657a9699e65f52d.tar.gz
gitea-dbd89acf980d7ab9f28cdcd33657a9699e65f52d.zip
Remove unnecessary permissions load (#9796)
Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <matti@mdranta.net>
Diffstat (limited to 'routers/repo/milestone.go')
-rw-r--r--routers/repo/milestone.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/routers/repo/milestone.go b/routers/repo/milestone.go
index b4056cc6d1..3e81ea0452 100644
--- a/routers/repo/milestone.go
+++ b/routers/repo/milestone.go
@@ -268,13 +268,8 @@ 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.Data["CanWriteIssues"] = ctx.Repo.CanWriteIssuesOrPulls(false)
+ ctx.Data["CanWritePulls"] = ctx.Repo.CanWriteIssuesOrPulls(true)
ctx.HTML(200, tplMilestoneIssues)
}