From 68008baf0ec639339625b5198e432ac1c05305da Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 24 Feb 2021 11:16:47 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20email=20permissions=20fo?= =?UTF-8?q?r=20all=20roles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Team/issues/494 The migrations in 3.1.0 which added email permissions did not add those permissions to the roles. This means that whilst we have the permissions in the database, only the Owner role could use any of them. This migration ensures that the email related permissions are added to the correct roles. --- .../4.0/24-add-missing-email-permissions.js | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 core/server/data/migrations/versions/4.0/24-add-missing-email-permissions.js diff --git a/core/server/data/migrations/versions/4.0/24-add-missing-email-permissions.js b/core/server/data/migrations/versions/4.0/24-add-missing-email-permissions.js new file mode 100644 index 0000000000..07fead0319 --- /dev/null +++ b/core/server/data/migrations/versions/4.0/24-add-missing-email-permissions.js @@ -0,0 +1,36 @@ +const { + addPermissionWithRoles, + combineTransactionalMigrations +} = require('../../utils'); + +module.exports = combineTransactionalMigrations( + addPermissionWithRoles({ + name: 'Read emails', + action: 'read', + object: 'email' + }, [ + 'Administrator', + 'Admin Integration', + 'Editor', + 'Author', + 'Contributor' + ]), + addPermissionWithRoles({ + name: 'Browse emails', + action: 'browse', + object: 'email' + }, [ + 'Administrator', + 'Admin Integration', + 'Editor' + ]), + addPermissionWithRoles({ + name: 'Retry emails', + action: 'retry', + object: 'email' + }, [ + 'Administrator', + 'Admin Integration', + 'Editor' + ]) +);