You are here

function uuidreference_autocomplete_access_callback in UUID reference field 7

Menu Access callback for the autocomplete widget.

Parameters

string $target_type: The entity type this field instance is attached to.

string $bundle: The bundle this field instance is attached to.

$field_name: The name of the entity-reference field.

Return value

True if user can access this menu item.

1 string reference to 'uuidreference_autocomplete_access_callback'
uuidreference_menu in ./uuidreference.module

File

./uuidreference.module, line 38

Code

function uuidreference_autocomplete_access_callback($entity_type, $bundle, $field_name) {
  $field = field_info_field($field_name);
  $instance = field_info_instance($entity_type, $field_name, $bundle);
  if ($field && $instance && $field['type'] == 'uuidreference' && field_access('edit', $field, $entity_type)) {
    return TRUE;
  }
  return FALSE;
}