You are here

function rooms_unit_access in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Determines whether the given user has access to a bookable unit.

Parameters

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

RoomsUnit $unit: Optionally a unit or a unit type 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

boolean Whether access is allowed or not.

9 calls to rooms_unit_access()
rooms_availability_event in modules/rooms_availability/rooms_availability.module
Displays the necessary json for the date range provided - needs at least start year and month at which point it will return the entire month.
rooms_availability_get_style in modules/rooms_availability/rooms_availability.module
Helper function to determine the $event style depending on permissions.
rooms_booking_edit_form_get_rooms in modules/rooms_booking/rooms_booking.admin.inc
Returns a set of available units given a unit type, start and end dates.
rooms_booking_views_ajax_autocomplete_unit in modules/rooms_booking/views/rooms_booking.views.inc
Page callback for views rooms_unit autocomplete.
rooms_unit_access_filter in modules/rooms_unit/rooms_unit.module
Filters rooms unit based on permissions for multiple values.

... See full list

4 string references to 'rooms_unit_access'
RoomsUnitUIController::hook_menu in modules/rooms_unit/rooms_unit.admin.inc
Overrides hook_menu() defaults. Main reason for doing this is that parent class hook_menu() is optimized for entity type administration.
rooms_availability_menu in modules/rooms_availability/rooms_availability.module
Implements hook_menu().
rooms_pricing_menu in modules/rooms_pricing/rooms_pricing.module
Implements hook_menu().
rooms_unit_entity_info in modules/rooms_unit/rooms_unit.module
Implements hook_entity_info().

File

modules/rooms_unit/rooms_unit.module, line 214
Manage units - Units are things that can be booked on a nightly basis (e.g. rooms - but also villas bungalows, etc).

Code

function rooms_unit_access($op, $unit = NULL, $account = NULL) {
  return rooms_entity_access($op, $unit, $account, 'rooms_unit');
}