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/v093.js

32 lines
700 B

RocketChat.Migrations.add({
version: 93,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
const setting = RocketChat.models.Settings.findOne({ _id: 'Accounts_AllowAnonymousAccess' });
if (setting && setting.value === true) {
RocketChat.models.Settings.update({ _id: 'Accounts_AllowAnonymousRead' }, { $set: { value: setting.value } });
}
}
const query = {
_id: {
$in: [
'view-c-room',
'view-history',
'view-joined-room',
'view-p-room',
'preview-c-room'
]
}
};
const update = {
$addToSet: {
roles: 'anonymous'
}
};
RocketChat.models.Permissions.update(query, update, { multi: true });
}
});