You can filter the_content
to make sure only people with the right cap can see it:
function filter_the_content( $content ) {
// Check post type is book
// and that the current user is not lite user
if (get_post_type() == 'book'
&& ! current_user_can( 'read_book' ) ) {
// return a message in place of the content
return 'Why do you want to see this book? You can\'t read!';
}
// otherwise, show content
return $content;
}
add_filter( 'the_content', 'filter_the_content' );
However!
This will only work for lite user, meaning that any other user (including admins) won’t be able to see it from the front end.
You will have to add the read_book
capability to other roles.
Hope that’s what you are looking for.