From ce2a408256dcd81690f812dee95b0797e8880824 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 11 Jul 2012 17:07:46 -0400
Subject: [PATCH] Fixed bug in ConfigUserService when user has nothing other than an account name

---
 src/com/gitblit/ConfigUserService.java |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/com/gitblit/ConfigUserService.java b/src/com/gitblit/ConfigUserService.java
index 66eb176..9b0cf57 100644
--- a/src/com/gitblit/ConfigUserService.java
+++ b/src/com/gitblit/ConfigUserService.java
@@ -737,6 +737,12 @@
 			if (model.excludeFromFederation) {
 				roles.add(Constants.NOT_FEDERATED_ROLE);
 			}
+			if (roles.size() == 0) {
+				// we do this to ensure that user record with no password
+				// is written.  otherwise, StoredConfig optimizes that account
+				// away. :(
+				roles.add(Constants.NO_ROLE);
+			}
 			config.setStringList(USER, model.username, ROLE, roles);
 
 			// repository memberships

--
Gitblit v1.9.1