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:
@@ -66,7 +66,7 @@ public class Emails implements
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
return new AccountResource.Email(rsrc.getUser(), email);
|
||||
} else if (rsrc.getUser().getEmailAddresses().contains(id.get())) {
|
||||
} else if (rsrc.getUser().hasEmailAddress(id.get())) {
|
||||
return new AccountResource.Email(rsrc.getUser(), id.get());
|
||||
} else {
|
||||
throw new ResourceNotFoundException();
|
||||
|
Reference in New Issue
Block a user