Rename node_access_write_grants() to _node_access_write_grants() and discourage its use

Created on 23 March 2008, about 17 years ago
Updated 19 March 2025, about 2 months ago

http://api.drupal.org/api/function/node_access_write_grants says

Modules which utilize node_access can use this function when doing mass updates due to widespread permission changes.

So, apparently, node_access_write_grants() may be called by contrib modules, right?

However, if grants are collected by node_access_acquire_grants() (for example from node_access_rebuild()), then node_access_acquire_grants() calls node_access_write_grants() only for the grants with the highest priority. No other grants are written.

This means, modules that call node_access_write_grants() directly, may write grants that would not be written during a node_access_rebuild(), and we get an inconsistent {node_access} table.

Do we have a problem here, or what am I missing?

📌 Task
Status

Fixed

Version

11.0 🔥

Component

node system

Created by

🇨🇭Switzerland salvis

Live updates comments and jobs are added and updated live.
  • API change

    Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024