[PLT-6838] Restrict channel delete option per permission policy even for last channel member (#6706)

* channel delete option is hidden from the menu unless there is appropriate permissions as set in the policy page

* apply to public channel only and add restriction to API layer

* updated channel deletion
Этот коммит содержится в:
Saturnino Abril
2017-07-05 06:32:27 +08:00
коммит произвёл GitHub
родитель 6d6ed309b9
Коммит 8f8a978e84
6 изменённых файлов: 45 добавлений и 37 удалений

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

@@ -720,11 +720,7 @@ export default class ChannelHeader extends React.Component {
);
}
if (ChannelUtils.showDeleteOption(channel, isAdmin, isSystemAdmin, isChannelAdmin)) {
if (!ChannelStore.isDefault(channel)) {
dropdownContents.push(deleteOption);
}
} else if (this.state.userCount === 1) {
if (ChannelUtils.showDeleteOption(channel, isAdmin, isSystemAdmin, isChannelAdmin, this.state.userCount)) {
dropdownContents.push(deleteOption);
}