You are here

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

Update permission names for rooms_booking entity management.

File

modules/rooms_booking/rooms_booking.install, line 327
Sets up the base table for our entity and a table to store information about the entity types.

Code

function rooms_booking_update_7005() {

  // Load utility functions.
  module_load_install('rooms');
  $map = array(
    'administer booking types' => 'administer rooms_booking_type entities',
    'administer bookings' => 'bypass rooms_booking entities access',
  );
  $entity_info = entity_get_info('rooms_booking');
  foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {
    $map['view any ' . $bundle_name . ' booking'] = 'view any rooms_booking entity of bundle ' . $bundle_name;
    $map['edit any ' . $bundle_name . ' booking'] = 'update any rooms_booking entity of bundle ' . $bundle_name;
  }
  commerce_update_rename_permissions($map);
  return t('Role and custom View permissions updated for order entity management. Access checks in modules and permissions on default Views must be updated manually.');
}