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:
@@ -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