nodetype_access.module in Nodetype access 8
Same filename and directory in other branches
Node access module file.
File
nodetype_access.moduleView source
<?php
/**
* @file
* Node access module file.
*/
use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\node\NodeInterface;
/**
* Implement hook_node_access().
*/
function nodetype_access_node_access(NodeInterface $node, $op, AccountInterface $account) {
/** @var \Drupal\nodetype_access\NodeTypeAccessService $service */
$service = \Drupal::service('nodetype_access.service');
$accessResult = $service
->hookNodeAccess($node, $op, $account);
return $accessResult;
}
/**
* Implement hook_query_TAG_alter().
*/
function nodetype_access_query_node_access_alter(AlterableInterface $query) {
/** @var \Drupal\nodetype_access\NodeTypeAccessService $service */
$service = \Drupal::service('nodetype_access.service');
$service
->hookQueryNodeAccessAlter($query);
}
function nodetype_access_permissions_callback() {
/** @var \Drupal\nodetype_access\NodeTypeAccessService $service */
$service = \Drupal::service('nodetype_access.service');
return $service
->permissions();
}
Functions
Name | Description |
---|---|
nodetype_access_node_access | Implement hook_node_access(). |
nodetype_access_permissions_callback | |
nodetype_access_query_node_access_alter | Implement hook_query_TAG_alter(). |