You are here

bat.api.php in Booking and Availability Management Tools for Drupal 8

Same filename and directory in other branches
  1. 7 bat.api.php

This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

File

bat.api.php
View source
<?php

/**
 * @file
 * This file contains no working PHP code; it exists to provide additional
 * documentation for doxygen as well as to document hooks in the standard
 * Drupal manner.
 */

/**
 * Allows modules to deny or provide access for a user to perform a non-view
 * operation on an entity before any other access check occurs.
 *
 * 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.
 *
 * @param \Drupal\Core\Entity\EntityInterface $entity
 *   The entity to perform the operation on.
 * @param $operation
 *   The request operation: update, create, or delete.
 * @param \Drupal\Core\Session\AccountInterface $account
 *   The user account whose access should be determined.
 *
 * @return 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.
 */
function hook_bat_entity_access(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Session\AccountInterface $account) {

  // No example.
}

Functions

Namesort descending Description
hook_bat_entity_access Allows modules to deny or provide access for a user to perform a non-view operation on an entity before any other access check occurs.