ChangedFieldItemList.php 465 B

123456789101112131415161718192021
  1. <?php
  2. namespace Drupal\Core\Field;
  3. use Drupal\Core\Access\AccessResult;
  4. use Drupal\Core\Session\AccountInterface;
  5. /**
  6. * Defines a item list class for changed fields.
  7. */
  8. class ChangedFieldItemList extends FieldItemList {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function defaultAccess($operation = 'view', AccountInterface $account = NULL) {
  13. // It is not possible to edit the changed field.
  14. return AccessResult::allowedIf($operation !== 'edit');
  15. }
  16. }