diff options
author | James Moger <james.moger@gitblit.com> | 2012-07-11 17:07:46 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-07-11 17:07:46 -0400 |
commit | ce2a408256dcd81690f812dee95b0797e8880824 (patch) | |
tree | 63222797e4ad1fd3eb895d9fb1108466b4870039 | |
parent | 62aeb92c04024a90d9ed392bb79de03a246a45d8 (diff) | |
download | gitblit-ce2a408256dcd81690f812dee95b0797e8880824.tar.gz gitblit-ce2a408256dcd81690f812dee95b0797e8880824.zip |
Fixed bug in ConfigUserService when user has nothing other than an account name
-rw-r--r-- | src/com/gitblit/ConfigUserService.java | 6 | ||||
-rw-r--r-- | src/com/gitblit/Constants.java | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/com/gitblit/ConfigUserService.java b/src/com/gitblit/ConfigUserService.java index 66eb1760..9b0cf571 100644 --- a/src/com/gitblit/ConfigUserService.java +++ b/src/com/gitblit/ConfigUserService.java @@ -737,6 +737,12 @@ public class ConfigUserService implements IUserService { 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
diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java index b11505c0..772c768d 100644 --- a/src/com/gitblit/Constants.java +++ b/src/com/gitblit/Constants.java @@ -43,6 +43,8 @@ public class Constants { public static final String ADMIN_ROLE = "#admin";
public static final String NOT_FEDERATED_ROLE = "#notfederated";
+
+ public static final String NO_ROLE = "#none";
public static final String PROPERTIES_FILE = "gitblit.properties";
|