You are here

function realname_autocomplete_access_callback in Real Name 7

Menu Access callback for the autocomplete widget.

Parameters

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

string $entity_type: The entity type.

string $bundle_name: The bundle name.

Return value

bool True if user can access this menu item.

1 string reference to 'realname_autocomplete_access_callback'
realname_menu in ./realname.module
Implements hook_menu().

File

./realname.module, line 468
Provides token-based name displays for users.

Code

function realname_autocomplete_access_callback($field_name, $entity_type, $bundle_name) {
  $field = field_info_field($field_name);
  $instance = field_info_instance($entity_type, $field_name, $bundle_name);
  if (!$field || !$instance || $field['type'] != 'entityreference' || !field_access('edit', $field, $entity_type)) {
    return FALSE;
  }
  return TRUE;
}