8.5.x entity.api.php hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle)
8.0.x entity.api.php hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle)
8.1.x entity.api.php hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle)
8.2.x entity.api.php hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle)
8.3.x entity.api.php hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle)
8.4.x entity.api.php hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle)
8.6.x entity.api.php hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle)

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

1 function implements hook_ENTITY_TYPE_create_access()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_test_entity_test_create_access in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_create_access() for 'entity_test'.

File

core/lib/Drupal/Core/Entity/entity.api.php, line 659
Hooks and documentation related to entities.

Code

function hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $account, array $context, $entity_bundle) {

  // No opinion.
  return AccessResult::neutral();
}