aboutsummaryrefslogtreecommitdiffstats
path: root/modules/middleware
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-03 18:40:52 -0500
committerUnknwon <u@gogs.io>2015-11-03 18:40:52 -0500
commit6f0a41b8b28ba33382ab8d655c0d015324be7647 (patch)
treed30191b529354c42aaf8ae4066d73b402c0b4bb2 /modules/middleware
parent25ec20d5251511ebd0b9e6b963e189b860c39704 (diff)
downloadgitea-6f0a41b8b28ba33382ab8d655c0d015324be7647.tar.gz
gitea-6f0a41b8b28ba33382ab8d655c0d015324be7647.zip
#1511 Allow local import only for admin users
Diffstat (limited to 'modules/middleware')
-rw-r--r--modules/middleware/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index 97d9050b21..1b3288e52c 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -420,7 +420,7 @@ func RequireRepoAdmin() macaron.Handler {
// GitHookService checks if repository Git hooks service has been enabled.
func GitHookService() macaron.Handler {
return func(ctx *Context) {
- if !ctx.User.AllowGitHook && !ctx.User.IsAdmin {
+ if !ctx.User.CanEditGitHook() {
ctx.Handle(404, "GitHookService", nil)
return
}