You are here

function formassembly_entity_field_access in FormAssembly 8

Implements hook_entity_field_access().

File

./formassembly.module, line 75
Procedural code for formassembly module.

Code

function formassembly_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
  if ($operation == 'edit' && $field_definition
    ->getType() == 'entityreference' && $field_definition
    ->getSetting(target_type) == 'fa_form') {
    return AccessResult::allowedIfHasPermission($account, 'reference formassembly');
  }
  return AccessResult::neutral();
}