function civicrm_entity_access in CiviCRM Entity 7
Same name and namespace in other branches
- 7.2 civicrm_entity.module \civicrm_entity_access()
Entity access callback.
Parameters
$op:
$entity:
$account: _type
Return value
bool
1 string reference to 'civicrm_entity_access'
- civicrm_entity_entity_info in ./
civicrm_entity.module - Here we declare selected CiviCRM entities to Drupal.
File
- ./
civicrm_entity.module, line 54 - Implement CiviCRM entities as a Drupal Entity.
Code
function civicrm_entity_access($op, $entity, $account, $entity_type) {
if ($op == 'view' && $entity_type == 'civicrm_event') {
return user_access('view event info');
}
elseif ($op == 'view' && $entity_type == 'civicrm_participant') {
return user_access('view event participants');
}
else {
return user_access('administer CiviCRM');
}
}