mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Added labs safeguard for announcementBar settings
refs https://github.com/TryGhost/Team/issues/3051 - An extra safeguard to prevent announcementBar feature variables from accidentally leaking through the Content API.
This commit is contained in:
parent
22c45ee9b1
commit
f9fbac8fa5
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,7 @@ const settingsCache = require('../../../shared/settings-cache');
|
|||
const urlUtils = require('../../../shared/url-utils');
|
||||
const ghostVersion = require('@tryghost/version');
|
||||
const announcementBarSettings = require('../../services/announcement-bar-service');
|
||||
const labs = require('../../../shared/labs');
|
||||
|
||||
module.exports = {
|
||||
docName: 'settings',
|
||||
|
@ -9,7 +10,10 @@ module.exports = {
|
|||
browse: {
|
||||
permissions: true,
|
||||
query(frame) {
|
||||
const announcementSettings = announcementBarSettings.getAnnouncementSettings(frame.options.context?.member);
|
||||
let announcementSettings;
|
||||
if (labs.isSet('announcementBar')) {
|
||||
announcementSettings = announcementBarSettings.getAnnouncementSettings(frame.options.context?.member);
|
||||
}
|
||||
|
||||
// @TODO: decouple settings cache from API knowledge
|
||||
// The controller fetches models (or cached models) and the API frame for the target API version formats the response.
|
||||
|
|
Loading…
Add table
Reference in a new issue