2019-08-09 19:41:24 +05:30
|
|
|
module.exports = {
|
|
|
|
get permissions() {
|
|
|
|
return require('./permissions');
|
|
|
|
},
|
|
|
|
|
|
|
|
get serializers() {
|
|
|
|
return require('./serializers');
|
|
|
|
},
|
|
|
|
|
|
|
|
get validators() {
|
|
|
|
return require('./validators');
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description Does the request access the Content API?
|
|
|
|
*
|
|
|
|
* Each controller is either for the Content or for the Admin API.
|
|
|
|
* When Ghost registers each controller, it currently passes a String "content" if the controller
|
|
|
|
* is a Content API implementation - see index.js file.
|
|
|
|
*
|
|
|
|
* @TODO: Move this helper function into a utils.js file.
|
|
|
|
* @param {Object} frame
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
isContentAPI: (frame) => {
|
|
|
|
return frame.apiType === 'content';
|
|
|
|
},
|
|
|
|
|
2022-05-16 13:23:26 +01:00
|
|
|
isInternal: (frame) => {
|
|
|
|
return frame.options.context && frame.options.context.internal;
|
2019-08-09 19:41:24 +05:30
|
|
|
}
|
|
|
|
};
|