class HierarchyNodeIsRemovableAccessCheck in Entity Reference Hierarchy 8
Determines whether the requested node can be removed from its entity_hierarchy.
Hierarchy
- class \Drupal\entity_hierarchy\Access\HierarchyNodeIsRemovableAccessCheck implements AccessInterface
Expanded class hierarchy of HierarchyNodeIsRemovableAccessCheck
1 string reference to 'HierarchyNodeIsRemovableAccessCheck'
1 service uses HierarchyNodeIsRemovableAccessCheck
File
- src/
Access/ HierarchyNodeIsRemovableAccessCheck.php, line 18 - Contains Drupal\entity_hierarchy\Access\HierarchyNodeIsRemovableAccessCheck.
Namespace
Drupal\entity_hierarchy\AccessView source
class HierarchyNodeIsRemovableAccessCheck implements AccessInterface {
/**
* Hierarchy Manager Service.
*
* @var \Drupal\entity_hierarchy\HierarchyManagerInterface
*/
protected $entity_hierarchyManager;
/**
* Constructs a HierarchyNodeIsRemovableAccessCheck object.
*
* @param \Drupal\entity_hierarchy\HierarchyManagerInterface $entity_hierarchy_manager
* Hierarchy Manager Service.
*/
public function __construct(HierarchyManagerInterface $entity_hierarchy_manager) {
$this->entity_hierarchyManager = $entity_hierarchy_manager;
}
/**
* Checks access for removing the node from its entity_hierarchy.
*
* @param \Drupal\node\NodeInterface $node
* The node requested to be removed from its entity_hierarchy.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public function access(NodeInterface $node) {
return AccessResult::allowedIf($this->entity_hierarchyManager
->checkNodeIsRemovable($node))
->cacheUntilEntityChanges($node);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HierarchyNodeIsRemovableAccessCheck:: |
protected | property | Hierarchy Manager Service. | |
HierarchyNodeIsRemovableAccessCheck:: |
public | function | Checks access for removing the node from its entity_hierarchy. | |
HierarchyNodeIsRemovableAccessCheck:: |
public | function | Constructs a HierarchyNodeIsRemovableAccessCheck object. |