- Issue created by @altcom_neil
- Status changed to Needs review
about 1 year ago 11:57am 25 August 2023 - last update
about 1 year ago Composer require-dev failure
When ever any change is made to a User Role, even simply renaming the Role, the update hook is called and the a node access rebuild flag is set. Node access rebuild is an incredibly time consuming process for large websites with thousands of node.
The node access table only needs rebuilding if permissions have changed, and only the permissions that this module uses.
Edit a Role and change it's name, not even changing a permission.
You will now have the warning message to rebuild all of the node access permissions even though no permissions have changed.
Only call node_access_needs_rebuild(TRUE);
if a permission has changed in a role that will effect any of the filters that this module adds.
I have patched the views_node_access_filter_user_role_update(EntityInterface $entity)
method to only call the rebuild function if a role has either gained or lost one of the following permissions:
This should reduce the amount of times that the node access table is flagged to rebuild.
I'm not sure if that is the correct set of permissions to monitor?
Needs review
1.0
Code