Added access property to entries for v3+ api

no-issue

This is done at the theme layer so that we do not introduce new concepts
to the api which may go away very quickly due to the beta status of
members.
This commit is contained in:
Fabien O'Carroll 2019-10-15 16:54:30 +07:00
parent fb072395ac
commit d6b0db39c0
2 changed files with 7 additions and 1 deletions

View File

@ -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); helpers.secure(req, entry);
const renderer = helpers.renderEntry(req, res); const renderer = helpers.renderEntry(req, res);

View File

@ -48,7 +48,8 @@ describe('Unit - services/routing/controllers/entry', function () {
resourceType: 'posts' resourceType: 'posts'
}, },
render: sinon.spy(), render: sinon.spy(),
redirect: sinon.spy() redirect: sinon.spy(),
locals: {}
}; };
}); });