The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/server/services/user/lib/getNewUserRoles.ts

12 lines
477 B

import type { IRole } from '@rocket.chat/core-typings';
import { settings } from '../../../../app/settings/server';
import { parseCSV } from '../../../../lib/utils/parseCSV';
export function getNewUserRoles(previousRoles?: IRole['_id'][]): IRole['_id'][] {
const currentRoles = previousRoles ?? [];
const defaultUserRoles = parseCSV(settings.get<string>('Accounts_Registration_Users_Default_Roles') || '');
return [...new Set([...currentRoles, ...defaultUserRoles])];
}