Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

Any entity access controller that extends \Drupal\Core\Entity\EntityAccessController will now invoke hook_entity_access() and hook_entity_create_access() next to hook_ENTITY_TYPE_access() and hook_ENTITY_TYPE_create_access(). To check the entity type in hook_entity_access(), call $entity->entityType(). See entity.api.php the hooks' arguments and return values.

Example:

<?php
use Drupal\Core\Entity\EntityInterface;
use
Drupal\Core\Session\AccountInterface;
/**
* Implements hook_entity_access().
*/
function hook_entity_access(EntityInterface $entity, $operation, AccountInterface $account, $langcode) {
 
$entity_types = array('foo', 'bar');
  if (
in_array($entity->entityType(), $entity_types)) {
    return
TRUE;
  }
  return
NULL;
}
/**
* Implements hook_entity_create_access().
*/
function hook_entity_create_access(AccountInterface $account, $langcode) {
  if (
$account->hasPermission('foo')) {
    return
TRUE;
  }
  return
NULL;
}
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done