function block_access_entity_create_access in Block Access 8
Implements hook_entity_create_access().
File
- ./
block_access.module, line 34 - Main module functionality.
Code
function block_access_entity_create_access(AccountInterface $account, array $context, $entity_bundle) {
if ($context['entity_type_id'] !== 'block_content') {
return AccessResult::neutral();
}
return AccessResult::allowedIfHasPermission($account, sprintf('create %s block_content', $entity_bundle));
}