public EntityAccessControlHandlerInterface::access(EntityInterface $entity, $operation, AccountInterface $account = NULL, $return_as_object = FALSE)
Checks access to an operation on a given entity or entity translation.
Use \Drupal\Core\Entity\EntityAccessControlHandlerInterface::createAccess() to check access to create an entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for which to check access.
string $operation: The operation access should be checked for. Usually