коммит произвёл
Christopher Speller
родитель
01e652ed48
Коммит
816a30397d
@@ -71,10 +71,10 @@ func TestCreateTeam(t *testing.T) {
|
||||
enableTeamCreation := th.App.Config().TeamSettings.EnableTeamCreation
|
||||
defer func() {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.EnableTeamCreation = enableTeamCreation })
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
}()
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.EnableTeamCreation = false })
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
|
||||
th.LoginBasic()
|
||||
_, resp = Client.CreateTeam(team)
|
||||
@@ -1297,12 +1297,12 @@ func TestAddTeamMember(t *testing.T) {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictTeamInvite = restrictTeamInvite })
|
||||
utils.SetIsLicensed(isLicensed)
|
||||
utils.SetLicense(license)
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
}()
|
||||
|
||||
// Set the config so that only team admins can add a user to a team.
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_TEAM_ADMIN })
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// Test without the EE license to see that the permission restriction is ignored.
|
||||
@@ -1313,7 +1313,7 @@ func TestAddTeamMember(t *testing.T) {
|
||||
utils.SetIsLicensed(true)
|
||||
utils.SetLicense(&model.License{Features: &model.Features{}})
|
||||
utils.License().Features.SetDefaults()
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// Check that a regular user can't add someone to the team.
|
||||
@@ -1327,7 +1327,7 @@ func TestAddTeamMember(t *testing.T) {
|
||||
utils.SetIsLicensed(true)
|
||||
utils.SetLicense(&model.License{Features: &model.Features{}})
|
||||
utils.License().Features.SetDefaults()
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// Should work as a team admin.
|
||||
@@ -1336,7 +1336,7 @@ func TestAddTeamMember(t *testing.T) {
|
||||
|
||||
// Change permission level to System Admin
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_SYSTEM_ADMIN })
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
|
||||
// Should not work as team admin.
|
||||
_, resp = Client.AddTeamMember(team.Id, otherUser.Id)
|
||||
@@ -1353,7 +1353,7 @@ func TestAddTeamMember(t *testing.T) {
|
||||
utils.SetIsLicensed(true)
|
||||
utils.SetLicense(&model.License{Features: &model.Features{}})
|
||||
utils.License().Features.SetDefaults()
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// Should work as a regular user.
|
||||
@@ -1364,7 +1364,7 @@ func TestAddTeamMember(t *testing.T) {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictTeamInvite = restrictTeamInvite })
|
||||
utils.SetIsLicensed(isLicensed)
|
||||
utils.SetLicense(license)
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// by hash and data
|
||||
@@ -1511,12 +1511,12 @@ func TestAddTeamMembers(t *testing.T) {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictTeamInvite = restrictTeamInvite })
|
||||
utils.SetIsLicensed(isLicensed)
|
||||
utils.SetLicense(license)
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
}()
|
||||
|
||||
// Set the config so that only team admins can add a user to a team.
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_TEAM_ADMIN })
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// Test without the EE license to see that the permission restriction is ignored.
|
||||
@@ -1527,7 +1527,7 @@ func TestAddTeamMembers(t *testing.T) {
|
||||
utils.SetIsLicensed(true)
|
||||
utils.SetLicense(&model.License{Features: &model.Features{}})
|
||||
utils.License().Features.SetDefaults()
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// Check that a regular user can't add someone to the team.
|
||||
@@ -1541,7 +1541,7 @@ func TestAddTeamMembers(t *testing.T) {
|
||||
utils.SetIsLicensed(true)
|
||||
utils.SetLicense(&model.License{Features: &model.Features{}})
|
||||
utils.License().Features.SetDefaults()
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// Should work as a team admin.
|
||||
@@ -1550,7 +1550,7 @@ func TestAddTeamMembers(t *testing.T) {
|
||||
|
||||
// Change permission level to System Admin
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_SYSTEM_ADMIN })
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
|
||||
// Should not work as team admin.
|
||||
_, resp = Client.AddTeamMembers(team.Id, userList)
|
||||
@@ -1567,7 +1567,7 @@ func TestAddTeamMembers(t *testing.T) {
|
||||
utils.SetIsLicensed(true)
|
||||
utils.SetLicense(&model.License{Features: &model.Features{}})
|
||||
utils.License().Features.SetDefaults()
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
th.App.SetDefaultRolesBasedOnConfig()
|
||||
th.LoginBasic()
|
||||
|
||||
// Should work as a regular user.
|
||||
|
||||
Ссылка в новой задаче
Block a user