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
Related topics
- Entity API
- Describes how to define and manipulate content and configuration entities.
- Hooks
- Define functions that alter the behavior of Drupal core.
File
- core/lib/Drupal/Core/Entity/entity.api.php, line 644
- 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(); }
Please login to continue.