mirror of https://github.com/zulip/zulip.git
emoji_settings: Only allow admins to override default emoji.
Uptil now, any user could add a custom emoji with the same name as a default emoji, thus overriding it (with a confirmation after warning). To create more friction for this action, now only admins are allowed to add custom emojis that override default ones. All users can still add custom emojis with other names. Fixes part of #24120.
This commit is contained in:
parent
a4e477bf02
commit
8a5b71fdbd
|
@ -260,6 +260,17 @@ export function set_up() {
|
|||
}
|
||||
|
||||
if (is_default_emoji(emoji.name)) {
|
||||
if (!page_params.is_admin) {
|
||||
ui_report.client_error(
|
||||
$t_html({
|
||||
defaultMessage:
|
||||
"Failed: There is a default emoji with this name. Only administrators can override default emoji.",
|
||||
}),
|
||||
$emoji_status,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const html_body = emoji_settings_warning_modal({
|
||||
emoji_name: emoji.name,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue