function NodeTestHooks::nodeGrants

Implements hook_node_grants().

Attributes

#[Hook('node_grants')]

File

core/modules/node/tests/modules/node_test/src/Hook/NodeTestHooks.php, line 60

Class

NodeTestHooks
Hook implementations for node_test.

Namespace

Drupal\node_test\Hook

Code

public function nodeGrants(AccountInterface $account, $operation) : array {
  // Give everyone full grants so we don't break other node tests.
  // Our node access tests asserts three realms of access.
  // See testGrantAlter().
  return [
    'test_article_realm' => [
      1,
    ],
    'test_page_realm' => [
      1,
    ],
    'test_alter_realm' => [
      2,
    ],
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.