You are here

function bat_unit_access in Booking and Availability Management Tools for Drupal 7

Same name and namespace in other branches
  1. 8 modules/bat_unit/bat_unit.module \bat_unit_access()

Determines whether the given user has access to a unit.

Parameters

string $op: The operation being performed. One of 'view', 'update', 'create', 'delete' or just 'edit' (being the same as 'create' or 'update').

BatUnit $unit: Optionally a unit or a unit bundle to check access for. If nothing is given, access for all units is determined.

object $account: The user to check for. Leave it to NULL to check for the global user.

Return value

bool Whether access is allowed or not.

5 calls to bat_unit_access()
bat_unit_access_filter in modules/bat_unit/bat_unit.module
Filters units based on permissions for multiple values.
bat_unit_add_access in modules/bat_unit/bat_unit.module
Access callback: Checks whether the user has permission to add a unit.
bat_unit_edit_form in modules/bat_unit/bat_unit.admin.inc
Form callback: create or edit a unit.
bat_unit_handler_delete_link_field::render in modules/bat_unit/views/bat_unit_handler_delete_link_field.inc
Render the field.
bat_unit_handler_edit_link_field::render in modules/bat_unit/views/bat_unit_handler_edit_link_field.inc
Render the field.
3 string references to 'bat_unit_access'
BatTypeUIController::hook_menu in modules/bat_unit/bat_type.admin.inc
Overrides hook_menu() defaults.
BatUnitUIController::hook_menu in modules/bat_unit/bat_unit.admin.inc
Overrides hook_menu() defaults.
bat_unit_entity_info in modules/bat_unit/bat_unit.module
Implements hook_entity_info().

File

modules/bat_unit/bat_unit.module, line 608

Code

function bat_unit_access($op, BatUnit $unit = NULL, $account = NULL) {
  return bat_entity_access($op, $unit, $account, 'bat_unit');
}