You are here

function hook_crm_core_entity_access in CRM Core 7

Deny or allow access to entity CRUD before any other access check.

Modules implementing this hook can return FALSE to provide a blanket prevention for the user to perform the requested operation on the specified entity. If no modules implementing this hook return FALSE but at least one returns TRUE, then the operation will be allowed, even for a user without role based permission to perform the operation.

If no modules return FALSE but none return TRUE either, normal permission based checking will apply.


string $op: The request operation: update, create, or delete.

object $entity: The entity to perform the operation on.

object $account: The user account whose access should be determined.

string $entity_type: The machine-name of the entity type of the given $entity.

Return value

bool TRUE or FALSE indicating an explicit denial of permission or a grant in the presence of no other denials; NULL to not affect the access check at all.

2 invocations of hook_crm_core_entity_access()
crm_core_activity_access in modules/crm_core_activity/crm_core_activity.module
Access callback for activity.
crm_core_contact_access in modules/crm_core_contact/crm_core_contact.module
Check permission for various contact operations.


./crm_core.api.php, line 38
Hooks provided by the CRM Core module.


function hook_crm_core_entity_access($op, $entity, $account, $entity_type) {

  // No example.