class BookNodeIsRemovableAccessCheck in Drupal 8
Same name and namespace in other branches
- 9 core/modules/book/src/Access/BookNodeIsRemovableAccessCheck.php \Drupal\book\Access\BookNodeIsRemovableAccessCheck
- 10 core/modules/book/src/Access/BookNodeIsRemovableAccessCheck.php \Drupal\book\Access\BookNodeIsRemovableAccessCheck
Determines whether the requested node can be removed from its book.
Hierarchy
- class \Drupal\book\Access\BookNodeIsRemovableAccessCheck implements AccessInterface
Expanded class hierarchy of BookNodeIsRemovableAccessCheck
1 string reference to 'BookNodeIsRemovableAccessCheck'
- book.services.yml in core/
modules/ book/ book.services.yml - core/modules/book/book.services.yml
1 service uses BookNodeIsRemovableAccessCheck
File
- core/
modules/ book/ src/ Access/ BookNodeIsRemovableAccessCheck.php, line 13
Namespace
Drupal\book\AccessView source
class BookNodeIsRemovableAccessCheck implements AccessInterface {
/**
* Book Manager Service.
*
* @var \Drupal\book\BookManagerInterface
*/
protected $bookManager;
/**
* Constructs a BookNodeIsRemovableAccessCheck object.
*
* @param \Drupal\book\BookManagerInterface $book_manager
* Book Manager Service.
*/
public function __construct(BookManagerInterface $book_manager) {
$this->bookManager = $book_manager;
}
/**
* Checks access for removing the node from its book.
*
* @param \Drupal\node\NodeInterface $node
* The node requested to be removed from its book.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public function access(NodeInterface $node) {
return AccessResult::allowedIf($this->bookManager
->checkNodeIsRemovable($node))
->addCacheableDependency($node);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BookNodeIsRemovableAccessCheck:: |
protected | property | Book Manager Service. | |
BookNodeIsRemovableAccessCheck:: |
public | function | Checks access for removing the node from its book. | |
BookNodeIsRemovableAccessCheck:: |
public | function | Constructs a BookNodeIsRemovableAccessCheck object. |