Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / system / tests / modules / entity_test / entity_test.module
index e5fa873d0969ec954e2b54ce62d5026e854f447e..cc9a09ca691bfcbf233ab9713f0d8b320ec1731f 100644 (file)
@@ -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);