mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
7b761a8751
no issue Adds new canary api endpoint, currently replicating v2 endpoint but paving way for future updates to new version
35 lines
1017 B
JavaScript
35 lines
1017 B
JavaScript
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';
|
|
},
|
|
|
|
// @TODO: Remove, not used.
|
|
isAdminAPIKey: (frame) => {
|
|
return frame.options.context && Object.keys(frame.options.context).length !== 0 && frame.options.context.api_key &&
|
|
frame.options.context.api_key.type === 'admin';
|
|
}
|
|
};
|