Added permissions for Authors to read labels

refs https://github.com/TryGhost/Team/issues/1618

- Authors require access to labels as part of the publish + send workflow
This commit is contained in:
Matt Hanley 2022-05-12 14:53:32 +01:00 committed by Matt Hanley
parent ad9e916700
commit 0d379a9264
6 changed files with 23 additions and 9 deletions

View File

@ -0,0 +1,12 @@
const {combineTransactionalMigrations, addPermissionToRole} = require('../../utils');
module.exports = combineTransactionalMigrations(
addPermissionToRole({
permission: 'Browse labels',
role: 'Author'
}),
addPermissionToRole({
permission: 'Read labels',
role: 'Author'
})
);

View File

@ -737,6 +737,7 @@
"email_preview": "read",
"email": "read",
"snippet": ["browse", "read"],
"label": ["browse", "read"],
"product": ["browse", "read"],
"newsletter": ["browse", "read"]
},

View File

@ -131,8 +131,8 @@ describe('Database Migration (special functions)', function () {
permissions.should.havePermission('Add snippets', ['Administrator', 'Editor', 'Admin Integration']);
permissions.should.havePermission('Delete snippets', ['Administrator', 'Editor', 'Admin Integration']);
permissions.should.havePermission('Browse labels', ['Administrator', 'Editor', 'Admin Integration']);
permissions.should.havePermission('Read labels', ['Administrator', 'Editor', 'Admin Integration']);
permissions.should.havePermission('Browse labels', ['Administrator', 'Editor', 'Author', 'Admin Integration']);
permissions.should.havePermission('Read labels', ['Administrator', 'Editor', 'Author', 'Admin Integration']);
permissions.should.havePermission('Edit labels', ['Administrator', 'Admin Integration']);
permissions.should.havePermission('Add labels', ['Administrator', 'Admin Integration']);
permissions.should.havePermission('Delete labels', ['Administrator', 'Admin Integration']);

View File

@ -201,18 +201,18 @@ describe('Migration Fixture Utils', function () {
fixtureManager.addFixturesForRelation(fixtures.relations[0]).then(function (result) {
should.exist(result);
result.should.be.an.Object();
result.should.have.property('expected', 88);
result.should.have.property('done', 88);
result.should.have.property('expected', 89);
result.should.have.property('done', 89);
// Permissions & Roles
permsAllStub.calledOnce.should.be.true();
rolesAllStub.calledOnce.should.be.true();
dataMethodStub.filter.callCount.should.eql(88);
dataMethodStub.filter.callCount.should.eql(89);
dataMethodStub.find.callCount.should.eql(7);
baseUtilAttachStub.callCount.should.eql(88);
baseUtilAttachStub.callCount.should.eql(89);
fromItem.related.callCount.should.eql(88);
fromItem.find.callCount.should.eql(88);
fromItem.related.callCount.should.eql(89);
fromItem.find.callCount.should.eql(89);
done();
}).catch(done);

View File

@ -36,7 +36,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '2f4266e6e5087ad92dd30f3e721d46e5';
const currentFixturesHash = '2219972fb91a30f8d740e05afd3a033c';
const currentFixturesHash = '2509ff2c1f6e0293a3c3d84f08593b2f';
const currentSettingsHash = '53606d11dafcd3f4ab1acb3962122082';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';

View File

@ -910,6 +910,7 @@
"email_preview": "read",
"email": "read",
"snippet": ["browse", "read"],
"label": ["browse", "read"],
"product": ["browse", "read"],
"newsletter": ["browse", "read"]
},