You are here

function biblio_contributor_access in Bibliography Module 7.3

Access function for the biblio contributor entity.

Parameters

$op: The type of the operation.

BiblioContributor $entity: The entity object.

$account: The user object.

$entity_type: The entity type.

Return value

bool Return TRUE/FALSE if the user has the privilege for this action.

2 string references to 'biblio_contributor_access'
biblio_entity_info in ./biblio.module
Implements hook_entity_info().
biblio_ui_menu in modules/biblio_ui/biblio_ui.module
Implements hook_menu().

File

./biblio.module, line 499
Maintains bibliographic lists.

Code

function biblio_contributor_access($op, BiblioContributor $entity = NULL, $account = NULL, $entity_type = NULL) {
  global $user;
  $account = $account ? $account : user_load($user->uid);
  if (user_access('administer biblio', $account)) {
    return TRUE;
  }
  $strings = array(
    'create' => 'create biblio contributor',
    'update' => 'edit biblio contributor',
    'delete' => 'delete biblio contributor',
    'view' => 'view biblio contributor',
  );
  return user_access($strings[$op], $account);
}