Allow user name to be cleared when unset in LDAP
If the user name is set in Gerrit, but is no longer configured in LDAP, allow it to be cleared by passing in a null name to the ChangeUserName action. Change-Id: Ie52fdf5b899e61456ea268aef93795ca00eed213 Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -32,6 +32,13 @@ technically a bug to produce a repository like this) wouldn't clone
|
||||
properly from the embedded Gerrit SSH or HTTP daemon. Fixed upstream
|
||||
in JGit 0.7.0, but we never picked up the bug fix release.
|
||||
|
||||
* Allow LDAP to unset the user name
|
||||
+
|
||||
If the user name is configured to be set only by the LDAP directory,
|
||||
and an account has a user name, but the name is no longer present
|
||||
in the directory, Gerrit crashed during sign-in while trying to
|
||||
clear out the user name. Fixed.
|
||||
|
||||
Documentation Corrections
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@ import java.util.Collections;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/** Operation to change the username of an account. */
|
||||
public class ChangeUserName implements Callable<VoidResult> {
|
||||
private static final Pattern USER_NAME_PATTERN =
|
||||
@@ -77,7 +79,7 @@ public class ChangeUserName implements Callable<VoidResult> {
|
||||
final SshKeyCache sshKeyCache,
|
||||
|
||||
@Assisted final ReviewDb db, @Assisted final IdentifiedUser user,
|
||||
@Assisted final String newUsername) {
|
||||
@Nullable @Assisted final String newUsername) {
|
||||
this.accountCache = accountCache;
|
||||
this.sshKeyCache = sshKeyCache;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user