mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
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:
parent
fb072395ac
commit
d6b0db39c0
@ -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);
|
||||||
|
@ -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: {}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user