stream settings: Hide creating admin-only streams in members UI.

This commit takes away the ability for non-admin members to create
streams where only admins can post messages by hiding the option from
them.

Fixes #11290.
This commit is contained in:
Vaibhav
2019-01-16 02:50:52 +05:30
committed by Tim Abbott
parent 268c25e95f
commit 746870df65
3 changed files with 4 additions and 0 deletions

View File

@@ -1230,6 +1230,7 @@ run_test('subscription_stream_privacy_modal', () => {
var args = {
stream_id: 999,
is_private: true,
is_admin: true,
};
var html = render('subscription_stream_privacy_modal', args);

View File

@@ -580,6 +580,7 @@ exports.setup_page = function (callback) {
hide_all_streams: !should_list_all_streams(),
max_name_length: page_params.stream_name_max_length,
max_description_length: page_params.stream_description_max_length,
is_admin: page_params.is_admin,
};
var rendered = templates.render('subscription_table_body', template_data);

View File

@@ -17,6 +17,7 @@
{{t '<b>Private, protected history:</b> must be invited by a member; new members can only see messages sent after they join; hidden from non-administrator users' }}
</label>
</li>
{{#if is_admin}}
<li>
<label class="checkbox">
<input type="checkbox" name="is-announcement-only" value="is-announcement-only" {{#if is_announcement_only}}checked{{/if}}/>
@@ -24,4 +25,5 @@
{{t 'Restrict posting to organization administrators' }}
</label>
</li>
{{/if}}
</ul>