MM-41569: Prevent compliance directory to be changed on cloud instances (#20198)

https://mattermost.atlassian.net/browse/MM-41659

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-05-13 14:14:26 +05:30
коммит произвёл GitHub
родитель bcd65c513b
Коммит 6e574aefd0
2 изменённых файлов: 30 добавлений и 0 удалений

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

@@ -247,6 +247,18 @@ func TestUpdateConfig(t *testing.T) {
assert.Equal(t, newURL, *cfg2.PluginSettings.MarketplaceURL)
})
t.Run("Should not be able to modify ComplianceSettings.Directory in cloud", func(t *testing.T) {
th.App.Srv().SetLicense(model.NewTestLicense("cloud"))
defer th.App.Srv().RemoveLicense()
cfg2 := th.App.Config().Clone()
*cfg2.ComplianceSettings.Directory = "hellodir"
_, resp, err = th.SystemAdminClient.UpdateConfig(cfg2)
require.Error(t, err)
CheckForbiddenStatus(t, resp)
})
t.Run("System Admin should not be able to clear Site URL", func(t *testing.T) {
siteURL := cfg.ServiceSettings.SiteURL
defer th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.SiteURL = siteURL })