class NodeRevisionAccessCheck in Node authorize link 8
Class NodeRevisionAccessCheck
@package Drupal\node_authlink\Access
Hierarchy
- class \Drupal\node\Access\NodeRevisionAccessCheck implements AccessInterface
- class \Drupal\node_authlink\Access\NodeRevisionAccessCheck
Expanded class hierarchy of NodeRevisionAccessCheck
1 string reference to 'NodeRevisionAccessCheck'
1 service uses NodeRevisionAccessCheck
File
- src/
Access/ NodeRevisionAccessCheck.php, line 16
Namespace
Drupal\node_authlink\AccessView source
class NodeRevisionAccessCheck extends NodeRevisionAccessCheckOriginal {
/**
* {@inheritdoc}
*/
public function checkAccess(NodeInterface $node, AccountInterface $account, $op = 'view') {
if (!$node
->isDefaultRevision() && node_authlink_node_is_enabled($node) && node_authlink_check_authlink($node, $op, $account)) {
$result = AccessResult::allowed();
}
else {
$result = parent::checkAccess($node, $account, $op);
}
if ($result instanceof AccessResultInterface) {
$result
->cachePerUser();
}
return $result;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
NodeRevisionAccessCheck:: |
protected | property | A static cache of access checks. | |
NodeRevisionAccessCheck:: |
protected | property | The node access control handler. | |
NodeRevisionAccessCheck:: |
protected | property | The node storage. | |
NodeRevisionAccessCheck:: |
public | function | Checks routing access for the node revision. | |
NodeRevisionAccessCheck:: |
public | function |
Checks node revision access. Overrides NodeRevisionAccessCheck:: |
|
NodeRevisionAccessCheck:: |
public | function | Constructs a new NodeRevisionAccessCheck. |