settings_org: Enhance `show_emails` for admins only case too.

This adds on the `is_admin` clause to show_emails.
This commit is contained in:
Pragati Agrawal 2019-07-18 18:51:09 +05:30 committed by Tim Abbott
parent a7f2bedb15
commit ac2f1cea9c
2 changed files with 10 additions and 2 deletions

View File

@ -21,6 +21,8 @@ popovers.hide_user_profile = noop;
set_global('current_msg_list', {});
set_global('page_params', {
is_admin: false,
realm_email_address_visibility: 3,
custom_profile_fields: [],
});
set_global('rows', {});

View File

@ -58,8 +58,14 @@ exports.email_address_visibility_values = {
exports.show_email = function () {
// TODO: Extend this when we add support for admins_and_members above.
return page_params.realm_email_address_visibility ===
exports.email_address_visibility_values.everyone.code;
if (page_params.realm_email_address_visibility ===
exports.email_address_visibility_values.everyone.code) {
return true;
}
if (page_params.realm_email_address_visibility ===
exports.email_address_visibility_values.admins_only.code) {
return page_params.is_admin;
}
};
exports.get_realm_time_limits_in_minutes = function (property) {