Drupal Duh

Drupal is a complex and powerful system, so sometimes we miss the obvious while looking for something more complicated.

Jul 25

#6

Problem: your implementation of hook_node_access_records() and hook_node_grants() isn’t working, returning FALSE for node_access() when it should return TRUE.

Complex solution: confirm that node_access_grants() returns the expected grants. Confirm that the grants give access in the node_access table. Reexamine your understanding of how grants work.

Actual solution: notice the nodes are unpublished, which makes the grants irrelevant.