mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 06:12:03 +03:00
7f7b477ce9
refs #10438 - integrations != users - Ghost's assumption is: if you create a post, the primary author becomes the logged in user - we have to require authors for integrations - short fix and needs some more thoughts later
30 lines
955 B
JavaScript
30 lines
955 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
|
|
);
|
|
},
|
|
|
|
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';
|
|
}
|
|
};
|