From 629806c4c04d3bfc058056069c3123fd91782639 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 27 Sep 2013 21:31:39 -0400
Subject: [PATCH] Added setting to globally disable anonymous pushes in the receive pack

---
 src/main/java/com/gitblit/git/GitblitReceivePackFactory.java |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/gitblit/git/GitblitReceivePackFactory.java b/src/main/java/com/gitblit/git/GitblitReceivePackFactory.java
index b9eb8a6..feb33e9 100644
--- a/src/main/java/com/gitblit/git/GitblitReceivePackFactory.java
+++ b/src/main/java/com/gitblit/git/GitblitReceivePackFactory.java
@@ -27,6 +27,7 @@
 import org.slf4j.LoggerFactory;
 
 import com.gitblit.GitBlit;
+import com.gitblit.Keys;
 import com.gitblit.models.RepositoryModel;
 import com.gitblit.models.UserModel;
 import com.gitblit.utils.HttpUtils;
@@ -80,8 +81,7 @@
 			timeout = client.getDaemon().getTimeout();
 		}
 
-		// TODO make this a setting
-		boolean allowAnonymousPushes = true;
+		boolean allowAnonymousPushes = GitBlit.getBoolean(Keys.git.allowAnonymousPushes, true);
 		if (!allowAnonymousPushes && UserModel.ANONYMOUS.equals(user)) {
 			// prohibit anonymous pushes
 			throw new ServiceNotEnabledException();

--
Gitblit v1.9.1