summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@users.noreply.github.com>2017-09-12 05:25:42 -0400
committerLauris BH <lauris@nix.lv>2017-09-12 12:25:42 +0300
commit9bdbfbf6f3289f4df0df5aae9998a08483f22218 (patch)
tree5ae5d89fbb745876517fba4abb2a0c007a3654de /models/user.go
parent3fecf94086be1b5f2bddd48cebc0e1ca4702de5c (diff)
downloadgitea-9bdbfbf6f3289f4df0df5aae9998a08483f22218.tar.gz
gitea-9bdbfbf6f3289f4df0df5aae9998a08483f22218.zip
Disable custom Git Hooks globally via configuration file (#2450)
* Create option to disable githooks globally via configuration file * Update comment in app.ini to align with @ethantkoenig's suggestion Signed-off-by: Matti Ranta <matti@mdranta.net>
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index 01f14edb7f..1e2502ebc0 100644
--- a/models/user.go
+++ b/models/user.go
@@ -237,7 +237,7 @@ func (u *User) CanCreateOrganization() bool {
// CanEditGitHook returns true if user can edit Git hooks.
func (u *User) CanEditGitHook() bool {
- return u.IsAdmin || u.AllowGitHook
+ return !setting.DisableGitHooks && (u.IsAdmin || u.AllowGitHook)
}
// CanImportLocal returns true if user can migrate repository by local path.