// posts - is real collection
backend.addProjection('posts_projection', 'posts', {id: true, title: true});
backend.allowRead('posts', async (docId, doc, session) => {
// Read posts_projection will fire this callback
return true;
});
backend.allowRead('posts_projection', async (docId, doc, session) => {
// We will never reach here and is still possible to read posts_projection
return false;
});
model.query('posts_users', {}); // Will fire allowRead('posts') instead of allowRead('posts_projection'), but this is wrong