How to determine create access for a given enitty and bundle This one feels like it should be obvious, but after some searching I'm having trouble finding a code example for checking whether a user has create access for an arbitrary entity.

In this case, I'm looking to pass an arbitrary entity type and bundle, in order to check whether a user has create access. This can be any entity type, including custom entities.

I have a sense that the end of the expression will be ->createAccess() , based on what I've read for the entity access interface classes, but where I'm stuck is finding the right class to call first, in order to get the entity information.
OK, I have figured it out. Here's what I am using to get access for the current user (in the createAccess() step the second parameter can be an account, if you need to pass an account):

// Before this, you need to get the entity type and bundle,
// shown here as $entity_type and $bundle .
$entity_manager = \Drupal::entityTypeManager();
$access_handler = $entity_manager-&gt;getAccessControlHandler($entity_type);
$access = FALSE;
if ($bundle) {
  $access = $access_handler-&gt;createAccess($bundle);
}
else {
  $access = $access_handler-&gt;createAccess();
}