mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added custom theme settings browse/edit permissions for Administrators (#13361)
refs https://github.com/TryGhost/Team/issues/1070TryGhost/Team#1070 - initial implementation will only allow browse+edit via the API
This commit is contained in:
parent
91a6917563
commit
b6d9bad6dc
5 changed files with 44 additions and 9 deletions
|
@ -0,0 +1,21 @@
|
|||
const {
|
||||
addPermissionWithRoles,
|
||||
combineTransactionalMigrations
|
||||
} = require('../../utils');
|
||||
|
||||
module.exports = combineTransactionalMigrations(
|
||||
addPermissionWithRoles({
|
||||
name: 'Browse custom theme settings',
|
||||
action: 'browse',
|
||||
object: 'custom_theme_setting'
|
||||
}, [
|
||||
'Administrator'
|
||||
]),
|
||||
addPermissionWithRoles({
|
||||
name: 'Edit custom theme settings',
|
||||
action: 'edit',
|
||||
object: 'custom_theme_setting'
|
||||
}, [
|
||||
'Administrator'
|
||||
])
|
||||
);
|
|
@ -491,6 +491,16 @@
|
|||
"name": "Reset all passwords",
|
||||
"action_type": "resetAllPasswords",
|
||||
"object_type": "authentication"
|
||||
},
|
||||
{
|
||||
"name": "Browse custom theme settings",
|
||||
"action_type": "browse",
|
||||
"object_type": "custom_theme_setting"
|
||||
},
|
||||
{
|
||||
"name": "Edit custom theme settings",
|
||||
"action_type": "edit",
|
||||
"object_type": "custom_theme_setting"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -738,6 +748,7 @@
|
|||
"email": "all",
|
||||
"member_signin_url": "read",
|
||||
"snippet": "all",
|
||||
"custom_theme_setting": "all",
|
||||
"authentication": "resetAllPasswords",
|
||||
"members_stripe_connect": "auth"
|
||||
},
|
||||
|
|
|
@ -45,7 +45,7 @@ describe('Database Migration (special functions)', function () {
|
|||
const permissions = this.obj;
|
||||
|
||||
// If you have to change this number, please add the relevant `havePermission` checks below
|
||||
permissions.length.should.eql(86);
|
||||
permissions.length.should.eql(88);
|
||||
|
||||
permissions.should.havePermission('Export database', ['Administrator', 'DB Backup Integration']);
|
||||
permissions.should.havePermission('Import database', ['Administrator', 'DB Backup Integration']);
|
||||
|
@ -154,6 +154,9 @@ describe('Database Migration (special functions)', function () {
|
|||
permissions.should.havePermission('Delete Products', ['Administrator']);
|
||||
|
||||
permissions.should.havePermission('Reset all passwords', ['Administrator']);
|
||||
|
||||
permissions.should.havePermission('Browse custom theme settings', ['Administrator']);
|
||||
permissions.should.havePermission('Edit custom theme settings', ['Administrator']);
|
||||
});
|
||||
|
||||
describe('Populate', function () {
|
||||
|
@ -211,7 +214,7 @@ describe('Database Migration (special functions)', function () {
|
|||
result.roles.at(7).get('name').should.eql('Scheduler Integration');
|
||||
|
||||
// Permissions
|
||||
result.permissions.length.should.eql(86);
|
||||
result.permissions.length.should.eql(88);
|
||||
result.permissions.toJSON().should.be.CompletePermissions();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -160,18 +160,18 @@ 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', 80);
|
||||
result.should.have.property('done', 80);
|
||||
result.should.have.property('expected', 81);
|
||||
result.should.have.property('done', 81);
|
||||
|
||||
// Permissions & Roles
|
||||
permsAllStub.calledOnce.should.be.true();
|
||||
rolesAllStub.calledOnce.should.be.true();
|
||||
dataMethodStub.filter.callCount.should.eql(80);
|
||||
dataMethodStub.filter.callCount.should.eql(81);
|
||||
dataMethodStub.find.callCount.should.eql(7);
|
||||
baseUtilAttachStub.callCount.should.eql(80);
|
||||
baseUtilAttachStub.callCount.should.eql(81);
|
||||
|
||||
fromItem.related.callCount.should.eql(80);
|
||||
fromItem.find.callCount.should.eql(80);
|
||||
fromItem.related.callCount.should.eql(81);
|
||||
fromItem.find.callCount.should.eql(81);
|
||||
|
||||
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 = '66e58a7b9081ccf78ac539a527f27332';
|
||||
const currentFixturesHash = '8e04dbcb4b8e429e70989572fc9c67b9';
|
||||
const currentFixturesHash = '1b842814f2b02ab8831c7e9c139d186e';
|
||||
const currentSettingsHash = 'aa3fcbc8ab119b630aeda7366ead5493';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue