user_groups: Remove "@" from name of role-based system groups.

This commit removes "@" from name of role-based system groups
since we have added a restricion on having user group names
starting with "@" in the previous commit as they look odd in
mention syntax.

We also add a migration in this commit to update the name of
role-based system groups in existing realms to remove "@"
from the name. This migration also updates the names of
non-system user groups by removing the invalid prefixes
from their names and if there is a group already with that
name, we insted name the group as "group:{group_id}".

Fixes #26148.
This commit is contained in:
Sahil Batra
2023-07-03 12:48:44 +05:30
committed by Tim Abbott
parent 929bf1243e
commit 2e4f7f6336
12 changed files with 155 additions and 69 deletions

View File

@@ -236,15 +236,15 @@ export function get_realm_user_groups_for_dropdown_list_widget(
const system_user_groups = settings_config.system_user_groups_list
.filter((group) => {
if (!allow_internet_group && group.name === "@role:internet") {
if (!allow_internet_group && group.name === "role:internet") {
return false;
}
if (!allow_owners_group && group.name === "@role:owners") {
if (!allow_owners_group && group.name === "role:owners") {
return false;
}
if (!allow_nobody_group && group.name === "@role:nobody") {
if (!allow_nobody_group && group.name === "role:nobody") {
return false;
}