private function TaxonomyTreeBuilder::hasAccess in Entity Reference Tree Widget 8
Same name and namespace in other branches
- 2.x src/Tree/TaxonomyTreeBuilder.php \Drupal\entity_reference_tree\Tree\TaxonomyTreeBuilder::hasAccess()
Check if a user has the access to the tree.
Parameters
\Drupal\Core\Session\AccountProxyInterface $user: The user object to check.
Return value
bool If the user has the access to the tree return TRUE, otherwise return FALSE.
1 call to TaxonomyTreeBuilder::hasAccess()
- TaxonomyTreeBuilder::loadTree in src/
Tree/ TaxonomyTreeBuilder.php - Load all entities from an entity bundle for the tree.
File
- src/
Tree/ TaxonomyTreeBuilder.php, line 136
Class
- TaxonomyTreeBuilder
- Provides a class for building a tree from taxonomy entity.
Namespace
Drupal\entity_reference_tree\TreeCode
private function hasAccess(AccountProxyInterface $user = NULL) {
// Check current user as default.
if (empty($user)) {
$user = \Drupal::currentUser();
}
return $user
->hasPermission($this->accessPermission);
}