From 760f850c2566ef3466c85941028d700ef0ebaffc Mon Sep 17 00:00:00 2001 From: Pierre Lehnen Date: Tue, 26 Nov 2019 03:59:28 -0300 Subject: [PATCH] Remove Old Permission --- server/startup/migrations/index.js | 1 + server/startup/migrations/v168.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 server/startup/migrations/v168.js 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'] }); + }, +});