function permissions_by_term_node_access in Permissions by Term 8
Same name and namespace in other branches
- 8.2 permissions_by_term.module \permissions_by_term_node_access()
- 7 permissions_by_term.module \permissions_by_term_node_access()
Implements hook_node_access().
Forwards user by drupal_access_denied(); to an access denied page, if a single restricted node is called.
This hook is not fired if admin is logged in. Users with the "bypass node access" permission may always view and edit content through the administrative interface.
File
- ./
permissions_by_term.module, line 268 - Allows access to terms in a vocabulary to be limited by user or role.
Code
function permissions_by_term_node_access(NodeInterface $node, $op, AccountInterface $account) {
/* @var \Drupal\permissions_by_term\Service\AccessCheck $accessCheck */
$accessCheck = \Drupal::service('permissions_by_term.access_check');
return $accessCheck
->handleNode($node
->id(), $node
->language()
->getId());
}