[MM-46694] A/B Test: welcome post (#20926)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Julien Tant
2022-10-13 14:23:22 -07:00
коммит произвёл GitHub
родитель a6a44b5824
Коммит 3747d99806
14 изменённых файлов: 230 добавлений и 0 удалений

Просмотреть файл

@@ -209,6 +209,19 @@ func (a *App) IsFirstUserAccount() bool {
return a.ch.srv.platform.IsFirstUserAccount()
}
func (a *App) IsFirstAdmin(user *model.User) bool {
if !user.IsSystemAdmin() {
return false
}
adminID, err := a.Srv().Store().User().GetFirstSystemAdminID()
if err != nil {
return false
}
return adminID == user.Id
}
// CreateUser creates a user and sets several fields of the returned User struct to
// their zero values.
func (a *App) CreateUser(c request.CTX, user *model.User) (*model.User, *model.AppError) {