You are here

function brightcove_field_view_access in Brightcove Video Connect 7.6

Same name and namespace in other branches
  1. 7.7 brightcove.module \brightcove_field_view_access()
  2. 7.3 brightcove_field/brightcove_field.module \brightcove_field_view_access()
  3. 7.5 brightcove_field/brightcove_field.module \brightcove_field_view_access()

Access callback for brightcove view in dialog.

1 string reference to 'brightcove_field_view_access'
brightcove_menu in ./brightcove.module
Implements hook_menu().

File

./brightcove.module, line 1216
Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.

Code

function brightcove_field_view_access($entity_type, $entity_id, $field_name) {
  $field = field_info_field($field_name);
  if (is_numeric($entity_id)) {
    $entity = entity_load($entity_type, [
      $entity_id,
    ]);
    if (count($entity)) {
      $entity = array_shift($entity);
      return entity_access('view', $entity_type, $entity) && field_access('view', $field, $entity_type);
    }
  }
  return FALSE;
}