summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/pull.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/api/v1/repo/pull.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/api/v1/repo/pull.go')
-rw-r--r--routers/api/v1/repo/pull.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go
index bca756aea1..e2e6c2799b 100644
--- a/routers/api/v1/repo/pull.go
+++ b/routers/api/v1/repo/pull.go
@@ -600,13 +600,7 @@ func MergePullRequest(ctx *context.APIContext, form auth.MergePullRequestForm) {
return
}
- perm, err := models.GetUserRepoPermission(ctx.Repo.Repository, ctx.User)
- if err != nil {
- ctx.Error(http.StatusInternalServerError, "GetUserRepoPermission", err)
- return
- }
-
- allowedMerge, err := pull_service.IsUserAllowedToMerge(pr, perm, ctx.User)
+ allowedMerge, err := pull_service.IsUserAllowedToMerge(pr, ctx.Repo.Permission, ctx.User)
if err != nil {
ctx.Error(http.StatusInternalServerError, "IsUSerAllowedToMerge", err)
return