[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>
Этот коммит содержится в:
@@ -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
|
||||
|
||||
Ссылка в новой задаче
Block a user