- 🇩🇪Germany Anybody Porta Westfalica
Same issue still exists for Drupal 8+, see ✨ Support views by implementing hook_node_grants and hook_node_access_records instead of hook_node_access Active
Again, I am not sure if I have everything right. I am eager to learn :)
Views does not seem to pick up the permissions set by this module. If I go to a single node, I can see I have access to the ones expected, and no access to the others. This works.
Now, if I build a view to show a list of the nodes, I get no results.
My take on this:
At https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hoo... we can read:
Also note that this function isn't called for node listings (e.g., RSS feeds, the default home page at path 'node', a recent content block, etc.) See Node access rights for a full explanation.
So as views is a node listing, I suspect this is why it wont work.
How to solve it?
Maybe the following two functions lead in the right direction? It seems to me that those grants would be picked up by views.
https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hoo...
https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hoo...
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Same issue still exists for Drupal 8+, see ✨ Support views by implementing hook_node_grants and hook_node_access_records instead of hook_node_access Active