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/server/services/user/lib/getNewUserRoles.ts

12 lines
396 B

import { settings } from '../../../../app/settings/server';
export function getNewUserRoles(previousRoles?: string[]): string[] {
const currentRoles = previousRoles ?? [];
const defaultUserRoles = String(settings.get('Accounts_Registration_Users_Default_Roles'))
.split(',')
.map((role) => role.trim())
.filter(Boolean);
return [...new Set([...currentRoles, ...defaultUserRoles])];
}