setting: Add dropdown for managing who can move messages between streams.

This commit adds the dropdown in 'Stream settings' section of organization
permissions page to control who can move messages between streams and
also hides the stream-edit UI in message-edit form accordingly.

Fixes #14499.
This commit is contained in:
sahil839
2021-04-30 13:05:20 +05:30
committed by Tim Abbott
parent 6f4af26585
commit c7d4640af5
5 changed files with 20 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import * as message_viewport from "./message_viewport";
import {page_params} from "./page_params";
import * as resize from "./resize";
import * as rows from "./rows";
import * as settings_data from "./settings_data";
import * as stream_bar from "./stream_bar";
import * as stream_data from "./stream_data";
import * as ui_report from "./ui_report";
@@ -346,7 +347,8 @@ function edit_message(row, raw_content) {
file_upload_enabled = true;
}
const show_edit_stream = message.is_stream && page_params.is_admin;
const show_edit_stream =
message.is_stream && settings_data.user_can_move_messages_between_streams();
// current message's stream has been already been added and selected in handlebar
const available_streams = show_edit_stream
? stream_data.subscribed_subs().filter((s) => s.stream_id !== message.stream_id)