When the node access callback try to index node access info, it assumes that if anonymous users can view the node in the current context, then it's a public node with no special restriction that should always be viewable by anonymous :

      // Check whether all users have access to the node.
      if (!node_access('view', $node, $account)) {
        [...]
      }
      else {
        // Add the generic view grant if we are not using node access or the
        // node is viewable by anonymous users.
        $items[$id]->search_api_access_node = array('node_access__all');
      }

This is not true for some custom node access modules declaring their own realms, for example according to the domain: the node might be publicly viewable on a domain but not on another.

Here's a patch that solves this.

Comments

drunken monkey’s picture

Status: Needs review » Closed (duplicate)

Thanks a lot for the suggestion and patch!
See #1617794-19: Make "Node access" compatible with additional contrib modules: it would be good to merge the "Node access" patches to get more testers, ensure they are compatible with each other, etc. I'll try to think of crediting you separately for your part of the patch still, though. (But feel free to also remind me of that when the patch is RTBC.)

betz’s picture

Any progress on this?
Organic groups content visibility permissions are not applied...

FreeAndEasy’s picture

This patch works great for domain access!