2018-10-05 00:50:45 +02:00
|
|
|
module.exports = {
|
|
|
|
get permissions() {
|
|
|
|
return require('./permissions');
|
|
|
|
},
|
|
|
|
|
|
|
|
get serializers() {
|
|
|
|
return require('./serializers');
|
|
|
|
},
|
|
|
|
|
|
|
|
get validators() {
|
|
|
|
return require('./validators');
|
2018-11-06 17:36:22 +05:30
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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 ||
|
2019-01-24 14:19:34 +00:00
|
|
|
(!frame.options.context.user && frame.options.context.api_key && (frame.options.context.api_key.type === 'content')) ||
|
2018-11-06 17:36:22 +05:30
|
|
|
frame.options.context.public
|
|
|
|
);
|
2018-10-05 00:50:45 +02:00
|
|
|
}
|
|
|
|
};
|