diff --git a/server/startup/migrations/index.js b/server/startup/migrations/index.js index ca39ce54a2c9..367b3f5f3c4c 100644 --- a/server/startup/migrations/index.js +++ b/server/startup/migrations/index.js @@ -165,4 +165,5 @@ import './v164'; import './v165'; import './v166'; import './v167'; +import './v168'; import './xrun'; diff --git a/server/startup/migrations/v168.js b/server/startup/migrations/v168.js new file mode 100644 index 000000000000..69dafb3f4f0f --- /dev/null +++ b/server/startup/migrations/v168.js @@ -0,0 +1,16 @@ +import { Migrations } from '../../../app/migrations/server'; +import { Permissions } from '../../../app/models/server'; + +Migrations.add({ + version: 168, + up() { + const perm = Permissions.findOne({ _id: 'reset-other-user-e2e-key' }); + + if (perm) { + Permissions.remove({ _id: 'reset-other-user-e2e-key' }); + } + }, + down() { + Permissions.upsert({ _id: 'reset-other-user-e2e-key' }, { _id: 'reset-other-user-e2e-key', roles: ['admin'] }); + }, +});