mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Fixed editors not being able to read labels when assigning member segments (#12934)
refs https://github.com/TryGhost/Team/issues/581 Editors are allowed to restrict post visibility and send emails to particular member segments, they need to be able to read labels so that they can select them in a member segment.
This commit is contained in:
parent
6c2869db61
commit
1ee97ccfbc
5 changed files with 28 additions and 13 deletions
|
@ -0,0 +1,14 @@
|
|||
const {combineTransactionalMigrations, addPermissionWithRoles} = require('../../utils');
|
||||
|
||||
module.exports = combineTransactionalMigrations(
|
||||
addPermissionWithRoles({
|
||||
name: 'Browse labels',
|
||||
action: 'browse',
|
||||
object: 'label'
|
||||
}, ['Editor']),
|
||||
addPermissionWithRoles({
|
||||
name: 'Read labels',
|
||||
action: 'read',
|
||||
object: 'label'
|
||||
}, ['Editor'])
|
||||
);
|
|
@ -773,6 +773,7 @@
|
|||
"email_preview": "all",
|
||||
"email": "all",
|
||||
"snippet": "all",
|
||||
"label": ["browse", "read"],
|
||||
"product": ["browse", "read"]
|
||||
},
|
||||
"Author": {
|
||||
|
|
|
@ -131,11 +131,11 @@ 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');
|
||||
permissions.should.havePermission('Read labels');
|
||||
permissions.should.havePermission('Edit labels');
|
||||
permissions.should.havePermission('Add labels');
|
||||
permissions.should.havePermission('Delete labels');
|
||||
permissions.should.havePermission('Browse labels', ['Administrator', 'Editor', 'Admin Integration']);
|
||||
permissions.should.havePermission('Read labels', ['Administrator', 'Editor', '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']);
|
||||
|
||||
permissions.should.havePermission('Read member signin urls');
|
||||
permissions.should.havePermission('Read identities');
|
||||
|
|
|
@ -160,19 +160,19 @@ describe('Migration Fixture Utils', function () {
|
|||
fixtureUtils.addFixturesForRelation(fixtures.relations[0]).then(function (result) {
|
||||
should.exist(result);
|
||||
result.should.be.an.Object();
|
||||
result.should.have.property('expected', 77);
|
||||
result.should.have.property('done', 77);
|
||||
result.should.have.property('expected', 78);
|
||||
result.should.have.property('done', 78);
|
||||
|
||||
// Permissions & Roles
|
||||
permsAllStub.calledOnce.should.be.true();
|
||||
rolesAllStub.calledOnce.should.be.true();
|
||||
dataMethodStub.filter.callCount.should.eql(77);
|
||||
dataMethodStub.filter.callCount.should.eql(78);
|
||||
dataMethodStub.find.callCount.should.eql(7);
|
||||
baseUtilAttachStub.callCount.should.eql(77);
|
||||
baseUtilAttachStub.callCount.should.eql(78);
|
||||
|
||||
fromItem.related.callCount.should.eql(77);
|
||||
fromItem.findWhere.callCount.should.eql(77);
|
||||
toItem[0].get.callCount.should.eql(154);
|
||||
fromItem.related.callCount.should.eql(78);
|
||||
fromItem.findWhere.callCount.should.eql(78);
|
||||
toItem[0].get.callCount.should.eql(156);
|
||||
|
||||
done();
|
||||
}).catch(done);
|
||||
|
|
|
@ -33,7 +33,7 @@ const defaultSettings = require('../../../../core/server/data/schema/default-set
|
|||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = 'b7bca80554f3946cd2f83e0e99ff3532';
|
||||
const currentFixturesHash = 'b24801cf9f819e4c127316021877ad70';
|
||||
const currentFixturesHash = '8671672598d2a62e53418c4b91aa79a3';
|
||||
const currentSettingsHash = 'c202cf5780aa77d8730a82680e2b142e';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue