v1/vendor/chi-teck/drupal-code-generator/templates/hook/node_grants.twig

13 lines
328 B
Twig

/**
* Implements hook_node_grants().
*/
function {{ machine_name }}_node_grants(\Drupal\Core\Session\AccountInterface $account, $op) {
if ($account->hasPermission('access private content')) {
$grants['example'] = [1];
}
if ($account->id()) {
$grants['example_author'] = [$account->id()];
}
return $grants;
}