You are here

function nodequeue_reference_autocomplete_access in Nodequeue reference 7

Menu access callback for nodequeue reference autocomplete paths.

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

1 string reference to 'nodequeue_reference_autocomplete_access'
nodequeue_reference_menu in ./nodequeue_reference.module
Implements hook_menu().

File

./nodequeue_reference.module, line 93
Form field type for node queues.

Code

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