[MM-27535] User invite limits for MM Cloud (#15197)

* Add a config for MM User Limit

* Adding graceful errors for if an administrator invites people passed their user limit

* Including changed vendor files

* Adding unit test

* Fix a bug

* Push up working tests (Thanks Joram)

* Add more cases, clean up logs in code

* One more case

* Refactoring based on PR comments

* Updating i18n

* Some changes based on PR review

* Remove a comment

* Bring back some translations that were somehow removed

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
nickmisasi
2020-08-19 16:01:07 -04:00
коммит произвёл GitHub
родитель 4e154756bd
Коммит 769f39eee5
20 изменённых файлов: 452 добавлений и 156 удалений

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

@@ -5069,6 +5069,28 @@ func (a *OpenTracingAppLayer) GetEnvironmentConfig() map[string]interface{} {
return resultVar0
}
func (a *OpenTracingAppLayer) GetErrorListForEmailsOverLimit(emailList []string, cloudUserLimit int64) ([]string, []*model.EmailInviteWithError, *model.AppError) {
origCtx := a.ctx
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetErrorListForEmailsOverLimit")
a.ctx = newCtx
a.app.Srv().Store.SetContext(newCtx)
defer func() {
a.app.Srv().Store.SetContext(origCtx)
a.ctx = origCtx
}()
defer span.Finish()
resultVar0, resultVar1, resultVar2 := a.app.GetErrorListForEmailsOverLimit(emailList, cloudUserLimit)
if resultVar2 != nil {
span.LogFields(spanlog.Error(resultVar2))
ext.Error.Set(span, true)
}
return resultVar0, resultVar1, resultVar2
}
func (a *OpenTracingAppLayer) GetFile(fileId string) ([]byte, *model.AppError) {
origCtx := a.ctx
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFile")