MM-14412: Enables force removals of team/channel members base on group constraints. (#10490)

* MM-14412: Enables force removals of team/channel members base on group constraints.

* Renames some existing methods and variables.

* Change return types to ChannelMembers and TeamMembers for some existing methods.

* Adds option to change LDAP_DATA to either 'qa' or 'test' with env variable.

* Adds methods to retrieve ChannelMembers and TeamMembers that, based on group constraints, should be deleted.

* Adds helper functions to create GroupTeams and GroupChannels.

* MM-14412: Switches to helper methods for GroupSyncable creation in test files.

* MM-14412: Style fix.

* MM-14412: Switches remaining GroupSyncable instances to be created with helper functions.

* MM-14412: Typo fix.

* MM-11412: Build fixes.

* MM-14412: Checks if user is team member before re-adding.

* MM-14412: Update for change of GroupConstrained fields type.
Этот коммит содержится в:
Martin Kraft
2019-04-02 09:22:50 -04:00
коммит произвёл GitHub
родитель cee65379c7
Коммит 25fd962016
23 изменённых файлов: 1212 добавлений и 607 удалений

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

@@ -135,12 +135,7 @@ func TestCreateGroupSyncable(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
group := th.CreateGroup()
groupSyncable := &model.GroupSyncable{
GroupId: group.Id,
AutoAdd: false,
SyncableId: th.BasicTeam.Id,
Type: model.GroupSyncableTypeTeam,
}
groupSyncable := model.NewGroupTeam(group.Id, th.BasicTeam.Id, false)
gs, err := th.App.CreateGroupSyncable(groupSyncable)
require.Nil(t, err)
@@ -155,12 +150,7 @@ func TestGetGroupSyncable(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
group := th.CreateGroup()
groupSyncable := &model.GroupSyncable{
GroupId: group.Id,
AutoAdd: false,
SyncableId: th.BasicTeam.Id,
Type: model.GroupSyncableTypeTeam,
}
groupSyncable := model.NewGroupTeam(group.Id, th.BasicTeam.Id, false)
gs, err := th.App.CreateGroupSyncable(groupSyncable)
require.Nil(t, err)
@@ -177,12 +167,7 @@ func TestGetGroupSyncables(t *testing.T) {
group := th.CreateGroup()
// Create a group team
groupSyncable := &model.GroupSyncable{
GroupId: group.Id,
AutoAdd: false,
SyncableId: th.BasicTeam.Id,
Type: model.GroupSyncableTypeTeam,
}
groupSyncable := model.NewGroupTeam(group.Id, th.BasicTeam.Id, false)
gs, err := th.App.CreateGroupSyncable(groupSyncable)
require.Nil(t, err)
@@ -198,12 +183,7 @@ func TestDeleteGroupSyncable(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
group := th.CreateGroup()
groupChannel := &model.GroupSyncable{
GroupId: group.Id,
AutoAdd: false,
SyncableId: th.BasicChannel.Id,
Type: model.GroupSyncableTypeChannel,
}
groupChannel := model.NewGroupChannel(group.Id, th.BasicChannel.Id, false)
gs, err := th.App.CreateGroupSyncable(groupChannel)
require.Nil(t, err)