]> source.dussan.org Git - gitblit.git/commitdiff
Fixed bug in ConfigUserService when user has nothing other than an account name
authorJames Moger <james.moger@gitblit.com>
Wed, 11 Jul 2012 21:07:46 +0000 (17:07 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 11 Jul 2012 21:07:46 +0000 (17:07 -0400)
src/com/gitblit/ConfigUserService.java
src/com/gitblit/Constants.java

index 66eb17606aede3c21c8d06bbea49ad79bbdc99d4..9b0cf571311cf6250b32b23bc49b01590a19989b 100644 (file)
@@ -737,6 +737,12 @@ public class ConfigUserService implements IUserService {
                        if (model.excludeFromFederation) {\r
                                roles.add(Constants.NOT_FEDERATED_ROLE);\r
                        }\r
+                       if (roles.size() == 0) {\r
+                               // we do this to ensure that user record with no password\r
+                               // is written.  otherwise, StoredConfig optimizes that account\r
+                               // away. :(\r
+                               roles.add(Constants.NO_ROLE);\r
+                       }\r
                        config.setStringList(USER, model.username, ROLE, roles);\r
 \r
                        // repository memberships\r
index b11505c0389bdeafcf36dcee8f029aa0a2e092dc..772c768d89d9bb6ef7cc28801f6e96454715622c 100644 (file)
@@ -43,6 +43,8 @@ public class Constants {
        public static final String ADMIN_ROLE = "#admin";\r
 \r
        public static final String NOT_FEDERATED_ROLE = "#notfederated";\r
+       \r
+       public static final String NO_ROLE = "#none";\r
 \r
        public static final String PROPERTIES_FILE = "gitblit.properties";\r
 \r