diff --git a/server/startup/migrations/index.js b/server/startup/migrations/index.js index 1aba72ee9c45..c3bfc88f5b18 100644 --- a/server/startup/migrations/index.js +++ b/server/startup/migrations/index.js @@ -213,4 +213,5 @@ import './v213'; import './v214'; import './v215'; import './v216'; +import './v217'; import './xrun'; diff --git a/server/startup/migrations/v217.js b/server/startup/migrations/v217.js new file mode 100644 index 000000000000..d618f85242ba --- /dev/null +++ b/server/startup/migrations/v217.js @@ -0,0 +1,12 @@ +import { Migrations } from '../../../app/migrations'; +import { Permissions } from '../../../app/models'; + +Migrations.add({ + version: 217, + up() { + const oldPermission = Permissions.findOne('view-livechat-queue'); + if (oldPermission) { + Permissions.update({ _id: 'view-livechat-queue' }, { $addToSet: { roles: 'livechat-agent' } }); + } + }, +});