First of all thanks for the useful module (and sorry for my bad english :P)

as reported from the documentation and comments in code, node_access_write_grants() should not be called directly by a contrib module, should be called node_access_acquire_grants() instead.
Replace the call to node_access_write_grants with node_access_acquire_grants allow better integration with other content access modules and be able to take full advantage of the mechanism provided by the core, including alter the grants (hook_node_access_records_alter() now is completely bypassed).

I also think that in order to maintain the consistency of the nodes configurations data is more correct to read the configuration from the table nodeaccess and not directly from node_access, which is subject to change in case of multiple modules that manage access to content.

patch attached

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

willzyx’s picture

Issue summary: View changes
willzyx’s picture

patch splitted in two different patches because i realized that there are two different issues:

1)nodeaccess-2342327-use-node_access_acquire_grants.patch
Replace the call to node_access_write_grants with node_access_acquire_grants for better integration with other content access modules.

2)nodeaccess-2342327-read-config-from-nodeaccess-table.patch
In case of multiple content access modules, if Nodeaccess has the lowest priority, it's grants are not written on node_access table and consequently the configuration on "grant" tab is not shown correctly. In order to maintain the consistency of the configurations data is more correct read the configuration from the table nodeaccess and not directly from node_access

(better open another issue for the second problem?)

willzyx’s picture

willzyx’s picture

vlad.pavlovic’s picture

Status: Needs review » Fixed

Absolutely right, ported the essence of the code to dev, as part of #2037899: Expose operations as API. Let me know if there are any issues. Thanks!

willzyx’s picture

great. I'll take a look at it soon.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.