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

23 lines
546 B

import { Migrations } from '../../../app/migrations';
import { Permissions } from '../../../app/models';
Migrations.add({
version: 127,
up() {
if (Permissions) {
const newPermission = Permissions.findOne('view-livechat-manager');
if (newPermission && newPermission.roles.length) {
Permissions.upsert({ _id: 'remove-closed-livechat-rooms' }, { $set: { roles: newPermission.roles } });
}
}
},
down() {
if (Permissions) {
// Revert permission
Permissions.remove({ _id: 'remove-closed-livechat-rooms' });
}
},
});