function hook_ENTITY_TYPE_create_access

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_create_access()
  2. 8.9.x core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_create_access()
  3. 10 core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_create_access()

Control entity create access for a specific entity type.

Parameters

\Drupal\Core\Session\AccountInterface $account: The account trying to access the entity.

array $context: An associative array of additional context values. By default it contains language:

  • langcode - the current language code.

string $entity_bundle: The entity bundle name.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

See also

\Drupal\Core\Entity\EntityAccessControlHandler

hook_ENTITY_TYPE_access()

hook_entity_create_access()

Related topics

File

core/lib/Drupal/Core/Entity/entity.api.php, line 797

Code

function hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle) : \Drupal\Core\Access\AccessResultInterface {
    // No opinion.
    return AccessResult::neutral();
}

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