I am trying to build a list of node ids that have view access for a specific role. Is this at all possible? I currently have an array of all 'page' content type nodes "pages".
I now need to loop through these and see if they have a specific role enabled, if so get the id and display the link on a page if the user has access to that page.
I know I can do that using the following example. But this just checks if the user has view access, and the user could have access from another role they have which my list would not be accurate for what I am trying to achieve.
if(node_access('view', $nodeid, $user)){
// do something
}
Or is there a way to check if a specific users role has view access rather than just access in general.
The reason I am trying to do this, is I am trying to get the list of specific pages dynamically if a role is given to that node "page".
Sorry if my terminology is off I am not super familiar with drupal.