function TermAccessControlHandler::checkCreateAccess

Same name in other branches
  1. 9 core/modules/taxonomy/src/TermAccessControlHandler.php \Drupal\taxonomy\TermAccessControlHandler::checkCreateAccess()
  2. 10 core/modules/taxonomy/src/TermAccessControlHandler.php \Drupal\taxonomy\TermAccessControlHandler::checkCreateAccess()
  3. 11.x core/modules/taxonomy/src/TermAccessControlHandler.php \Drupal\taxonomy\TermAccessControlHandler::checkCreateAccess()

Overrides EntityAccessControlHandler::checkCreateAccess

File

core/modules/taxonomy/src/TermAccessControlHandler.php, line 58

Class

TermAccessControlHandler
Defines the access control handler for the taxonomy term entity type.

Namespace

Drupal\taxonomy

Code

protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
    return AccessResult::allowedIfHasPermissions($account, [
        "create terms in {$entity_bundle}",
        'administer taxonomy',
    ], 'OR');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.