I am in middle of a problem where i have to check node access of current user against an array of node ids.
I have a two content types (A and B) and one contains the reference of other based on a taxonomy. A contains a user role reference fields to allow access to certain roles only. Now i want to show related contents from A on detail page of B. I have used a custom query to fetch all nodes from A somehow related to B. So code is looks like:
$related_nodes = <function_to_get_related_node>; $result = node_load_multiple($related_nodes);
I have restricted couple of node from A content type to display only certain user roles but $result shows all node from A. Node access not worked.
In my function i have used db_select() with addTag('node_access') but it doesn't seems to be working.
So Basically i want some sort of code to check node_access on array of $related_nodes and filter before it passed to node_load_multiple function. Could someone help me find a way? Thanks!