forked from a64f7bb4-7358-4778-9fbe-3b882c34cc1d/v1
13 lines
328 B
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;
|
|
}
|