🐛 Fixed email permissions for all roles

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.
This commit is contained in:
Fabien O'Carroll 2021-02-24 11:16:47 +00:00 committed by Fabien 'egg' O'Carroll
parent 1c7c246616
commit 68008baf0e

View File

@ -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'
])
);