Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Field / ChangedFieldItemList.php
diff --git a/web/core/lib/Drupal/Core/Field/ChangedFieldItemList.php b/web/core/lib/Drupal/Core/Field/ChangedFieldItemList.php
new file mode 100644 (file)
index 0000000..f781dc9
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+namespace Drupal\Core\Field;
+
+use Drupal\Core\Access\AccessResult;
+use Drupal\Core\Session\AccountInterface;
+
+/**
+ * Defines a item list class for changed fields.
+ */
+class ChangedFieldItemList extends FieldItemList {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function defaultAccess($operation = 'view', AccountInterface $account = NULL) {
+    // It is not possible to edit the changed field.
+    return AccessResult::allowedIf($operation !== 'edit');
+  }
+
+}