X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fentity_test%2Fentity_test.module;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fentity_test%2Fentity_test.module;h=cc9a09ca691bfcbf233ab9713f0d8b320ec1731f;hp=e5fa873d0969ec954e2b54ce62d5026e854f447e;hb=bfbba508964731508b9bd6d5835c2edc858db95b;hpb=cb9a80db11fc6b014e5b1e693a5a391c95eb5d9a diff --git a/web/core/modules/system/tests/modules/entity_test/entity_test.module b/web/core/modules/system/tests/modules/entity_test/entity_test.module index e5fa873d0..cc9a09ca6 100644 --- a/web/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/web/core/modules/system/tests/modules/entity_test/entity_test.module @@ -160,15 +160,6 @@ function entity_test_entity_base_field_info_alter(&$fields, EntityTypeInterface } } -/** - * Implements hook_entity_field_storage_info(). - */ -function entity_test_entity_field_storage_info(EntityTypeInterface $entity_type) { - if ($entity_type->id() == 'entity_test_update') { - return \Drupal::state()->get('entity_test_update.additional_field_storage_definitions', []); - } -} - /** * Creates a new bundle for entity_test entities. * @@ -756,6 +747,16 @@ function entity_test_entity_access(EntityInterface $entity, $operation, AccountI return AccessResult::allowed(); } + // Create specific labels to allow or deny access based on certain test + // conditions. + // @see \Drupal\KernelTests\Core\Entity\EntityAccessControlHandlerTest + if ($entity->label() == 'Accessible') { + return AccessResult::allowed(); + } + if ($entity->label() == 'Inaccessible') { + return AccessResult::forbidden(); + } + // Uncacheable because the access result depends on a State key-value pair and // might therefore change at any time. $condition = \Drupal::state()->get("entity_test_entity_access.{$operation}." . $entity->id(), FALSE);