Include the performing user in the "Registrar updated" emails

Whenever a registrar is changed via the registrar console, we send out a
notification of that change.

Since we're going to allow Admins and soon Vendors to use the console in
addition to the registrars, it becomes important to know who actually performed
the changes if the registrars complain.

In addition, we will now send notifications for changes in Sandbox since we're
going to actually allow registrars to update sandbox data.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217539534
This commit is contained in:
guyben 2018-10-17 10:10:32 -07:00 committed by jianglai
parent f43125bb04
commit 06ce429c5a
4 changed files with 37 additions and 10 deletions

View file

@ -38,7 +38,11 @@ public abstract class AuthResult {
public String userIdForLogging() {
return userAuthInfo()
.map(userAuthInfo -> userAuthInfo.user().getEmail())
.map(
userAuthInfo ->
String.format(
"%s %s",
userAuthInfo.isUserAdmin() ? "admin" : "user", userAuthInfo.user().getEmail()))
.orElse("<logged-out user>");
}