You are here

function blockreference_autocomplete_access in Block reference 7

Same name and namespace in other branches
  1. 7.2 blockreference.module \blockreference_autocomplete_access()

Menu access callback for the autocomplete path.

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

1 string reference to 'blockreference_autocomplete_access'
blockreference_menu in ./blockreference.module
Implements hook_menu().

File

./blockreference.module, line 645
Defines a field type for referencing a block from a node.

Code

function blockreference_autocomplete_access($entity_type, $field_name) {
  return user_access('access content') && ($field = field_info_field($field_name)) && field_access('view', $field, $entity_type) && field_access('edit', $field, $entity_type);
}