diff --git a/core/frontend/services/routing/controllers/entry.js b/core/frontend/services/routing/controllers/entry.js index 53d906adf0..74d0e2d919 100644 --- a/core/frontend/services/routing/controllers/entry.js +++ b/core/frontend/services/routing/controllers/entry.js @@ -83,6 +83,11 @@ module.exports = function entryController(req, res, next) { })); } + // CASE: Add access property to entry for v3+ api + if (res.locals.apiVersion !== 'v0.1' && res.locals.apiVersion !== 'v2') { + entry.access = !!entry.html; + } + helpers.secure(req, entry); const renderer = helpers.renderEntry(req, res); diff --git a/core/test/unit/services/routing/controllers/entry_spec.js b/core/test/unit/services/routing/controllers/entry_spec.js index 67c5f3f3a8..2aa4bb2e24 100644 --- a/core/test/unit/services/routing/controllers/entry_spec.js +++ b/core/test/unit/services/routing/controllers/entry_spec.js @@ -48,7 +48,8 @@ describe('Unit - services/routing/controllers/entry', function () { resourceType: 'posts' }, render: sinon.spy(), - redirect: sinon.spy() + redirect: sinon.spy(), + locals: {} }; });