function TermAccessControlHandler::checkCreateAccess

Same name and namespace in other branches
  1. 11.x core/modules/taxonomy/src/TermAccessControlHandler.php \Drupal\taxonomy\TermAccessControlHandler::checkCreateAccess()
  2. 10 core/modules/taxonomy/src/TermAccessControlHandler.php \Drupal\taxonomy\TermAccessControlHandler::checkCreateAccess()
  3. 8.9.x core/modules/taxonomy/src/TermAccessControlHandler.php \Drupal\taxonomy\TermAccessControlHandler::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.