mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-14 11:05:50 +03:00
Enabled Admin integration for tiers and offers API (#14325)
As multiple tiers is now GA, we want to allow devs to be able to work with Tiers and offers via content/Admin API. This change - - updates fixtures to add permissions to admin integration role for new sites - adds migration to update existing sites to have correct permissions for role - whitelists add/edit/read/browse on tiers and offers API for integrations
This commit is contained in:
parent
52c1aadf05
commit
f9aa18a534
@ -0,0 +1,23 @@
|
||||
const {
|
||||
combineTransactionalMigrations,
|
||||
addPermissionToRole
|
||||
} = require('../../utils');
|
||||
|
||||
module.exports = combineTransactionalMigrations(
|
||||
addPermissionToRole({
|
||||
permission: 'Browse offers',
|
||||
role: 'Admin Integration'
|
||||
}),
|
||||
addPermissionToRole({
|
||||
permission: 'Read offers',
|
||||
role: 'Admin Integration'
|
||||
}),
|
||||
addPermissionToRole({
|
||||
permission: 'Edit offers',
|
||||
role: 'Admin Integration'
|
||||
}),
|
||||
addPermissionToRole({
|
||||
permission: 'Add offers',
|
||||
role: 'Admin Integration'
|
||||
})
|
||||
);
|
@ -0,0 +1,20 @@
|
||||
const {combineTransactionalMigrations, addPermissionToRole} = require('../../utils');
|
||||
|
||||
module.exports = combineTransactionalMigrations(
|
||||
addPermissionToRole({
|
||||
permission: 'Browse Products',
|
||||
role: 'Admin Integration'
|
||||
}),
|
||||
addPermissionToRole({
|
||||
permission: 'Read Products',
|
||||
role: 'Admin Integration'
|
||||
}),
|
||||
addPermissionToRole({
|
||||
permission: 'Edit Products',
|
||||
role: 'Admin Integration'
|
||||
}),
|
||||
addPermissionToRole({
|
||||
permission: 'Add Products',
|
||||
role: 'Admin Integration'
|
||||
})
|
||||
);
|
@ -668,7 +668,9 @@
|
||||
"label": "all",
|
||||
"email_preview": "all",
|
||||
"email": "all",
|
||||
"snippet": "all"
|
||||
"snippet": "all",
|
||||
"product": ["browse", "read", "add", "edit"],
|
||||
"offer": ["browse", "read", "add", "edit"]
|
||||
},
|
||||
"Editor": {
|
||||
"notification": "all",
|
||||
|
@ -29,6 +29,8 @@ const notImplemented = function (req, res, next) {
|
||||
users: ['GET'],
|
||||
themes: ['POST', 'PUT'],
|
||||
members: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||
tiers: ['GET', 'PUT', 'POST'],
|
||||
offers: ['GET', 'PUT', 'POST'],
|
||||
config: ['GET'],
|
||||
schedules: ['PUT'],
|
||||
files: ['POST'],
|
||||
|
@ -36,7 +36,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
||||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = 'b7867be4de694b4592d748c0367064b5';
|
||||
const currentFixturesHash = '84be2bb1d62b384260b72ebfc20f81dc';
|
||||
const currentFixturesHash = 'f4dd2a454e1999b6d149cc26ae52ced4';
|
||||
const currentSettingsHash = '71fa38d0c805c18ceebe0fda80886230';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user