public function HierarchyNodeIsRemovableAccessCheck::access in Entity Reference Hierarchy 8
Checks access for removing the node from its entity_hierarchy.
Parameters
\Drupal\node\NodeInterface $node: The node requested to be removed from its entity_hierarchy.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
File
- src/
Access/ HierarchyNodeIsRemovableAccessCheck.php, line 46 - Contains Drupal\entity_hierarchy\Access\HierarchyNodeIsRemovableAccessCheck.
Class
- HierarchyNodeIsRemovableAccessCheck
- Determines whether the requested node can be removed from its entity_hierarchy.
Namespace
Drupal\entity_hierarchy\AccessCode
public function access(NodeInterface $node) {
return AccessResult::allowedIf($this->entity_hierarchyManager
->checkNodeIsRemovable($node))
->cacheUntilEntityChanges($node);
}