[MM-31497] - Prevent end users from inviting people and exceeding the free tier limits (#16786)

* [MM-31497] - Prevent end users from inviting people and exceeding the free tier limits

* Update error

* Commit forgotten code

* Chnage impl-1

* Change impl-2

* Remove test

* Include tier status

* Renable permissions check

* Change endpoint name

* Update endpoint

* Update api4/cloud.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Add test for new endpoint

* Format code

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Этот коммит содержится в:
Allan Guwatudde
2021-02-03 18:56:40 +03:00
коммит произвёл GitHub
родитель d489868f28
Коммит ddd9439706
4 изменённых файлов: 49 добавлений и 1 удалений

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

@@ -1205,7 +1205,7 @@ func inviteUsersToTeam(c *Context, w http.ResponseWriter, r *http.Request) {
if graceful {
cloudUserLimit := *c.App.Config().ExperimentalSettings.CloudUserLimit
var invitesOverLimit []*model.EmailInviteWithError
if c.App.Srv().License() != nil && *c.App.Srv().License().Features.Cloud && cloudUserLimit > 0 && c.IsSystemAdmin() {
if c.App.Srv().License() != nil && *c.App.Srv().License().Features.Cloud && cloudUserLimit > 0 {
subscription, subErr := c.App.Cloud().GetSubscription()
if subErr != nil {
c.Err = subErr