MM-26015: ensure admin retains permissions to team after being removed from a team (#14961)

Summary:
Ensure admin retains permissions to team after being removed from a team

Ticket Link:
https://mattermost.atlassian.net/browse/MM-26015
Этот коммит содержится в:
Ashish Bhate
2020-07-08 16:59:16 +05:30
коммит произвёл GitHub
родитель 87be9bc2f5
Коммит eabae5437b
2 изменённых файлов: 9 добавлений и 16 удалений

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

@@ -52,4 +52,10 @@ func TestHasPermissionToTeam(t *testing.T) {
th.RemoveUserFromTeam(th.BasicUser, th.BasicTeam)
assert.False(t, th.App.HasPermissionToTeam(th.BasicUser.Id, th.BasicTeam.Id, model.PERMISSION_LIST_TEAM_CHANNELS))
th.LinkUserToTeam(th.SystemAdminUser, th.BasicTeam)
assert.True(t, th.App.HasPermissionToTeam(th.SystemAdminUser.Id, th.BasicTeam.Id, model.PERMISSION_LIST_TEAM_CHANNELS))
th.RemoveUserFromTeam(th.SystemAdminUser, th.BasicTeam)
// This used to fail before MM-26015
assert.True(t, th.App.HasPermissionToTeam(th.SystemAdminUser.Id, th.BasicTeam.Id, model.PERMISSION_LIST_TEAM_CHANNELS))
}