You are here

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

Returns an array of filter permissions.

Return value

array

1 string reference to 'EventPermissions::permissions'
bat_event.permissions.yml in modules/bat_event/bat_event.permissions.yml
modules/bat_event/bat_event.permissions.yml

File

modules/bat_event/src/EventPermissions.php, line 51
Contains \Drupal\bat_event\EventPermissions.

Class

EventPermissions

Namespace

Drupal\bat_event

Code

public function permissions() {
  $permissions = [];
  foreach (bat_event_get_types() as $bundle_name => $bundle_info) {
    $permissions['view calendar data for any ' . $bundle_name . ' event'] = [
      'title' => $this
        ->t('View calendar data for any %bundle @entity_type', [
        '@entity_type' => 'events',
        '%bundle' => $bundle_info
          ->label(),
      ]),
    ];
  }
  return $permissions + bat_entity_access_permissions('bat_event');
}