James Moger
2012-07-11 ce2a408256dcd81690f812dee95b0797e8880824
Fixed bug in ConfigUserService when user has nothing other than an account name
2 files modified
8 ■■■■■ changed files
src/com/gitblit/ConfigUserService.java 6 ●●●●● patch | view | raw | blame | history
src/com/gitblit/Constants.java 2 ●●●●● patch | view | raw | blame | history
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
src/com/gitblit/Constants.java
@@ -43,6 +43,8 @@
    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";