diff --git a/core/lib/Drupal/Core/Entity/ConfigEntityAccessControllerBase.php b/core/lib/Drupal/Core/Entity/ConfigEntityAccessControllerBase.php new file mode 100644 index 0000000..edf6f5b --- /dev/null +++ b/core/lib/Drupal/Core/Entity/ConfigEntityAccessControllerBase.php @@ -0,0 +1,42 @@ +entityInfo(); + + // Throw an exception if we don't have what we need on the entity type info. + if (!isset($entity_info['access_controller_permission'])) { + throw new \Exception("Entity types using ConfigEntityAccessControllerBase as their access controller must define the 'access_controller_permission' property."); + } + + $permission = $entity_info['access_controller_permission']; + + return $account->hasPermission($permission); + } + +} diff --git a/core/lib/Drupal/Core/Entity/ConfigEntityListControllerBase.php b/core/lib/Drupal/Core/Entity/ConfigEntityListControllerBase.php new file mode 100644 index 0000000..fbb3037 --- /dev/null +++ b/core/lib/Drupal/Core/Entity/ConfigEntityListControllerBase.php @@ -0,0 +1,41 @@ +getLabel($entity); + $row['operations']['data'] = $this->buildOperations($entity); + return $row; + } + +}