Add hasEmailAddress to IdentifiedUser
This allows validation code to pass in an email address for checking, and lets IdentifiedUser worry about how that occurs. This refactoring opens the door to delegating the check to backend systems that are not able to supply the entire valid email list for a user. Change-Id: I3db2b34d311d0c8f6f5c0cfdaa109d44fd79e264
This commit is contained in:
@@ -270,6 +270,10 @@ public class IdentifiedUser extends CurrentUser {
|
||||
return diffPref;
|
||||
}
|
||||
|
||||
public boolean hasEmailAddress(String email) {
|
||||
return getEmailAddresses().contains(email);
|
||||
}
|
||||
|
||||
public Set<String> getEmailAddresses() {
|
||||
if (emailAddresses == null) {
|
||||
emailAddresses = state().getEmailAddresses();
|
||||
|
||||
Reference in New Issue
Block a user