diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php index f04de79..281656b 100644 --- a/core/modules/node/node.api.php +++ b/core/modules/node/node.api.php @@ -29,11 +29,25 @@ * an ID. In that case, the return value of this hook would be an array of the * list IDs that this user is a member of. * - * A node access module may implement as many realms as necessary to properly - * define the access privileges for the nodes. Note that the system makes no - * distinction between published and unpublished nodes. It is the module's - * responsibility to provide appropriate realms to limit access to unpublished - * content. + * A node access module may implement as many realms as necessary to define the + * access privileges for the nodes properly. Note that in cases where + * single-node checks are performed, there is an option of enabling the user to + * view his own unpublished node. See @link node_access the Node Access topic + * @endlink for more information. The node access system makes no distinction + * between published and unpublished nodes. It is the module's responsibility to + * provide appropriate realms to limit access to unpublished content. + * + * If all modules ignore the access request, then the node_access table is used + * to determine access. All node access modules are queried using + * hook_node_grants() to assemble a list of "grant IDs" for the user. This list + * is compared against the table. If any row contains the node ID in question + * (or 0, which stands for "all nodes"), one of the grant IDs returned, and a + * value of TRUE for the operation in question, then access is granted. Note + * that this table is a list of grants; any matching row is sufficient to grant + * access to the node. In cases where users are able to view their own + * unpublished node, the permission 'view own unpublished content' has been set + * for that user and node access checks will stop there and hook_node_grants() + * will not be called. * * Node access records are stored in the {node_access} table and define which * grants are required to access a node. There is a special case for the view