You are here

public function BookingPermissions::permissions in Booking and Availability Management Tools for Drupal 8

1 string reference to 'BookingPermissions::permissions'
bat_booking.permissions.yml in modules/bat_booking/bat_booking.permissions.yml
modules/bat_booking/bat_booking.permissions.yml

File

modules/bat_booking/src/BookingPermissions.php, line 46
Contains \Drupal\bat_booking\BookingPermissions.

Class

BookingPermissions

Namespace

Drupal\bat_booking

Code

public function permissions() {
  $permissions = [];
  $permissions += bat_entity_access_permissions('bat_booking');
  foreach (bat_booking_get_bundles() as $bundle_name => $bundle_info) {
    $permissions['view own booking entities of bundle ' . $bundle_name] = [
      'title' => t('View own %bundle @entity_bundle', [
        '@entity_bundle' => 'bookings',
        '%bundle' => $bundle_info
          ->label(),
      ]),
    ];
    $permissions['view any booking entity of bundle ' . $bundle_name] = [
      'title' => t('View any %bundle @entity_bundle', [
        '@entity_bundle' => 'booking',
        '%bundle' => $bundle_info
          ->label(),
      ]),
    ];
  }
  return $permissions;
}