You are here

public function NodeAccessControlHandlerInterface::writeGrants in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/NodeAccessControlHandlerInterface.php \Drupal\node\NodeAccessControlHandlerInterface::writeGrants()

Writes a list of grants to the database, deleting any previously saved ones.

If a realm is provided, it will only delete grants from that realm, but it will always delete a grant from the 'all' realm. Modules that use node access can use this function when doing mass updates due to widespread permission changes.

Note: Don't call this function directly from a contributed module. Call node_access_acquire_grants() instead.

Parameters

\Drupal\node\NodeInterface $node: The node whose grants are being written.

$delete: (optional) If false, does not delete records. This is only for optimization purposes, and assumes the caller has already performed a mass delete of some form. Defaults to TRUE.

1 method overrides NodeAccessControlHandlerInterface::writeGrants()
NodeAccessControlHandler::writeGrants in core/modules/node/src/NodeAccessControlHandler.php
Writes a list of grants to the database, deleting any previously saved ones.

File

core/modules/node/src/NodeAccessControlHandlerInterface.php, line 53
Contains \Drupal\node\NodeAccessControlHandlerInterface.

Class

NodeAccessControlHandlerInterface
Node specific entity access control methods.

Namespace

Drupal\node

Code

public function writeGrants(NodeInterface $node, $delete = TRUE);