crm_core.api.php 1.33 KB
Newer Older
CitizenKane's avatar
CitizenKane committed
1 2 3 4
<?php

/**
 * @file
5 6
 * Hooks provided by the CRM Core module.
 */
7

8
/**
9
 * Deny or allow access to entity CRUD before any other access check.
10 11 12 13 14 15 16 17 18 19
 *
 * 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.
 *
20
 * @param string $op
21
 *   The request operation: update, create, or delete.
22
 * @param object $entity
23
 *   The entity to perform the operation on.
24
 * @param object $account
25
 *   The user account whose access should be determined.
26
 * @param string $entity_type
27 28
 *   The machine-name of the entity type of the given $entity.
 *
29
 * @return bool
30 31
 *   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.
32
 */
33 34 35
function hook_crm_core_entity_access($op, $entity, $account, $entity_type) {
  // No example.
}
36 37

/**
38
 * Use a custom label for a contact of bundle CONTACT_BUNDLE.
39 40
 */
function crm_core_contact_CONTACT_BUNDLE_label($entity) {
41 42
  // No example.
}