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>
This commit is contained in:
techknowlogick authored and Lauris BH committed 2017-09-12 12:25:42 +03:00
1 parent 3fecf94086
commit 9bdbfbf6f3
5 files changed
+9 -2

No files matched your search

+1 -1
View File
@@ -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.