[MM-29515] Don't allow slack imports in cloud installations (#16271)

* Don't allow slack imports in cloud installations

* Update api4/team.go

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

* Add a test case for when the import is restricted in cloud

* Update api4/team_test.go

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

* Check for cloud license instead of restrictsystemadmin

* fix tests

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Nick Misasi
2020-11-17 12:56:17 -05:00
коммит произвёл GitHub
родитель a5e2275b16
Коммит 887ef0b5e1
2 изменённых файлов: 19 добавлений и 0 удалений

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

@@ -1079,6 +1079,11 @@ func teamExists(c *Context, w http.ResponseWriter, r *http.Request) {
}
func importTeam(c *Context, w http.ResponseWriter, r *http.Request) {
if c.App.Srv().License() != nil && *c.App.Srv().License().Features.Cloud {
c.Err = model.NewAppError("importTeam", "api.restricted_system_admin", nil, "", http.StatusForbidden)
return
}
c.RequireTeamId()
if c.Err != nil {
return