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/startup/migrations/v247.ts

27 lines
899 B

import { settings, settingsRegistry } from '../../../app/settings/server';
import { addMigration } from '../../lib/migrations';
addMigration({
version: 247,
up() {
const customOauthServices = settings.getByRegexp(/Accounts_OAuth_Custom-[^-]+$/im);
const serviceNames = customOauthServices.map(([key]) => key.replace('Accounts_OAuth_Custom-', ''));
serviceNames.forEach((serviceName) => {
settingsRegistry.add(`Accounts_OAuth_Custom-${serviceName}-roles_to_sync`, '', {
type: 'string',
group: 'OAuth',
section: `Custom OAuth: ${serviceName}`,
i18nLabel: 'Accounts_OAuth_Custom_Roles_To_Sync',
i18nDescription: 'Accounts_OAuth_Custom_Roles_To_Sync_Description',
enterprise: true,
enableQuery: {
_id: `Accounts_OAuth_Custom-${serviceName}-merge_roles`,
value: true,
},
invalidValue: '',
modules: ['oauth-enterprise'],
});
});
},
});