You are here

function brightcove_field_view_access in Brightcove Video Connect 7.3

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

Access callback for brightcove view in dialog.

1 string reference to 'brightcove_field_view_access'
brightcove_field_menu in brightcove_field/brightcove_field.module
Implementation of hook_menu().

File

brightcove_field/brightcove_field.module, line 300
Brightcove field module provides a Content Construction Kit module to developers, allowing them to browse videos in their Brightcove Studio and upload them.

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, array(
      $entity_id,
    ));
    if (count($entity)) {
      $entity = array_shift($entity);
      return entity_access('view', $entity_type, $entity) && field_access('view', $field, $entity_type);
    }
  }
  return FALSE;
}