hook_node_grants_alter

Node access modules establish rules for user access to content.
hook_node_grants() defines permissions for a user to view, edit or
delete nodes by building a $grants array that indicates the permissions
assigned to the user by each node access module. This hook is called to allow
modules to modify the $grants array by reference, so the interaction of
multiple node access modules can be altered or advanced business logic can be
applied.

The resulting grants are then checked against the records stored in the
{node_access} table to determine if the operation may be completed.

A module may deny all access to a user by setting $grants to an empty array.

Parameters

Developers may use this hook to either add additional grants to a user
or to remove existing grants. These rules are typically based on either the
permissions assigned to a user role, or specific attributes of a user
account.