X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd7%2Fhook%2Ffield_access.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd7%2Fhook%2Ffield_access.twig;h=1d5ec7daf9ccdd060163c3041be5e0d925d3c12d;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 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 index 000000000..1d5ec7daf --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_access.twig @@ -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; +}