This module helps developers manage node access permissions by providing a service to efficiently update access grants for nodes. It allows you to trigger recalculations of access for specific nodes when other content is saved or updated, ensuring consistent permissions.
Helper module for developers working with Drupal core's node access API.
Methods provided:
NodeGrantsUpdater::update($node)
When you save a node, Drupal automatically triggers an update of access grants for that node. When a node is saved that should affect the access of other nodes, use a hook_node_update() / hook_node_insert() or a postSave method to trigger those other nodes to update themselves, too, with this code:
\Drupal::service('node_access_helper.update_node_grants')->update($nids);
(It will accept a node object, a node ID, or an array of either.)
Supporting this Module
You can support Agaric's overall contributions to Drupal and a bit beyond by supporting Drutopia at opencollective.com/drutopia. Thanks!
Ask your assistant about Node Access Helper
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.x-dev | Dev | 9–11 | Mar 1, 2025 |