PLT-7206: Remove the "Delete Channel" option for private channels if you're the last channel member and policy setting restricts channel deletion (#7050)

* PLT-7206: UI changes. Removed last user in channel loophole, refactored code to clean it up, added differentiated support for public and private channels, added unit tests. Still need to implement server-side checks

* PLT-7206: All helper methods in channel_utils.jsx now accept the same three boolean variables in the same order and use the same boolean logic to check their values.

* PLT-7206: Added unit tests for showManagementOptions(...)

* PLT-7206: Fixed test case descriptions

* Added unit tests for showCreateOption(...)

* PLT-7206: Added unit tests for canManageMembers(...)

* PLT-7206: Removed last person in channel loophole from server-side code

* PLT-7206: Reverted config.json

* PLT-7206: Fixed double negatives in unit test names

* PLT-7206: PR feedback - Removed confusing comment and unused variable
Этот коммит содержится в:
Jonathan
2017-08-09 09:34:09 -04:00
коммит произвёл GitHub
родитель 6b741c4cea
Коммит fd6856b674
15 изменённых файлов: 875 добавлений и 118 удалений

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

@@ -1064,15 +1064,13 @@ func TestDeleteChannel(t *testing.T) {
// last member of a public channel should have required permission to delete
publicChannel6 = th.CreateChannelWithClient(th.Client, model.CHANNEL_OPEN)
_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckForbiddenStatus(t, resp)
// last member of a private channel should be able to delete it regardless of required permissions
// last member of a private channel should not be able to delete it if they don't have required permissions
privateChannel7 = th.CreateChannelWithClient(th.Client, model.CHANNEL_PRIVATE)
_, resp = Client.DeleteChannel(privateChannel7.Id)
CheckNoError(t, resp)
CheckForbiddenStatus(t, resp)
}
func TestRestoreChannel(t *testing.T) {