You are here

function brightcove_client_access in Brightcove Video Connect 7.7

Same name and namespace in other branches
  1. 7.6 brightcove.client.inc \brightcove_client_access()

Access callback for brightcove_client entity.

Parameters

$op: Can be 'edit' or 'use'.

Entity|string $entity: Brightcove client entity or client ID.

$account: Loaded user account.

Return value

bool

5 calls to brightcove_client_access()
brightcove_client_set_default_access in ./brightcove.client.inc
Access callback.
brightcove_field_browse_access in ./brightcove.module
Access callback for brightcove browser.
brightcove_playlist_access in ./brightcove.playlist.inc
Access callback for playlist entities.
brightcove_video_access in ./brightcove.video.inc
Access callback for video entities.
_brightcove_load_my_clients in ./brightcove.module
Loads all clients which belong to a given or current user.
1 string reference to 'brightcove_client_access'
brightcove_entity_info in ./brightcove.module
Implements hook_entity_info().

File

./brightcove.client.inc, line 475
Client related code.

Code

function brightcove_client_access($op, $entity = NULL, $account = NULL) {

  // If we got ID try to load the entity.
  if (is_numeric($entity)) {
    $entity = brightcove_client_load($entity);
  }

  // If account is not set use the currently logged in user.
  if (is_null($account)) {
    global $user;
    $account = $user;
  }
  return _brightcove_client_access($op, empty($entity) ? NULL : $entity->bcid, $account);
}