feat: add "Reset to Default HTML" button

This commit is contained in:
Yang Luo
2023-12-30 00:47:10 +08:00
parent 14fcedcc5d
commit 27187b3a54
5 changed files with 85 additions and 7 deletions

View File

@ -886,6 +886,18 @@ func (user *User) GetId() string {
return fmt.Sprintf("%s/%s", user.Owner, user.Name)
}
func (user *User) GetFriendlyName() string {
if user.FirstName != "" && user.LastName != "" {
return fmt.Sprintf("%s, %s", user.FirstName, user.LastName)
} else if user.DisplayName != "" {
return user.DisplayName
} else if user.Name != "" {
return user.Name
} else {
return user.Id
}
}
func isUserIdGlobalAdmin(userId string) bool {
return strings.HasPrefix(userId, "built-in/") || strings.HasPrefix(userId, "app/")
}