Ghost/core/server/api/v2/utils/index.js
Nazar Gargol 6318b65cab Changed context.api_key_id to an object containing key type information
refs #9865

- Changed id passed for api_key to an object to be able to differenciate between admin and content api requests
- Added integration id to frame context
- Small refactoring of frame context initialization
2019-01-24 17:22:58 +00:00

25 lines
731 B
JavaScript

module.exports = {
get permissions() {
return require('./permissions');
},
get serializers() {
return require('./serializers');
},
get validators() {
return require('./validators');
},
/**
* TODO: We need to check for public context as permission stage overrides
* the whole context object currently: https://github.com/TryGhost/Ghost/issues/10099
*/
isContentAPI: (frame) => {
return !!(Object.keys(frame.options.context).length === 0 ||
(!frame.options.context.user && frame.options.context.api_key && (frame.options.context.api_key.type === 'content')) ||
frame.options.context.public
);
}
};