You are here

function reference_autocomplete_access in References 7.2

Menu access callback for reference autocomplete paths.

Check for both 'edit' and 'view' access in the unlikely event a user has edit but not view access.

2 string references to 'reference_autocomplete_access'
node_reference_menu in node_reference/node_reference.module
Implements hook_menu().
user_reference_menu in user_reference/user_reference.module
Implements hook_menu().

File

./references.module, line 14
Defines common base features for the various reference field types.

Code

function reference_autocomplete_access($entity_type, $bundle, $field_name, $entity = NULL, $account = NULL) {
  return user_access('access content', $account) && field_info_instance($entity_type, $field_name, $bundle) && ($field = field_info_field($field_name)) && field_access('view', $field, $entity_type, $entity, $account) && field_access('edit', $field, $entity_type, $entity, $account);
}