Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / entity_field_access.twig
1 /**
2  * Implements hook_entity_field_access().
3  */
4 function {{ machine_name }}_entity_field_access($operation, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, \Drupal\Core\Session\AccountInterface $account, \Drupal\Core\Field\FieldItemListInterface $items = NULL) {
5   if ($field_definition->getName() == 'field_of_interest' && $operation == 'edit') {
6     return AccessResult::allowedIfHasPermission($account, 'update field of interest');
7   }
8   return AccessResult::neutral();
9 }