mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 19:02:29 +03:00
3345618731
no issue * Added helper to check if API called is content API
25 lines
680 B
JavaScript
25 lines
680 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_id) ||
|
|
frame.options.context.public
|
|
);
|
|
}
|
|
};
|