[MM-46694] A/B Test: welcome post (#20926)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
13
app/user.go
13
app/user.go
@@ -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) {
|
||||
|
||||
Ссылка в новой задаче
Block a user