Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_access.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_access.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_access.twig
new file mode 100644 (file)
index 0000000..1d5ec7d
--- /dev/null
@@ -0,0 +1,9 @@
+/**
+ * Implements hook_field_access().
+ */
+function {{ machine_name }}_field_access($op, $field, $entity_type, $entity, $account) {
+  if ($field['field_name'] == 'field_of_interest' && $op == 'edit') {
+    return user_access('edit field of interest', $account);
+  }
+  return TRUE;
+}