You are here

public function TaxonomyViewsIntegratorPermissions::permissions in Taxonomy Views Integrator 8

Get permissions for Taxonomy Views Integrator.

Return value

array Permissions array.

1 string reference to 'TaxonomyViewsIntegratorPermissions::permissions'
tvi.permissions.yml in ./tvi.permissions.yml
tvi.permissions.yml

File

src/TaxonomyViewsIntegratorPermissions.php, line 47

Class

TaxonomyViewsIntegratorPermissions
Permissions generator for TVI.

Namespace

Drupal\tvi

Code

public function permissions() {
  $permissions = [];
  foreach ($this->entityTypeManager
    ->getStorage('taxonomy_vocabulary')
    ->loadMultiple() as $vocabulary) {
    $permissions += [
      'define view for vocabulary ' . $vocabulary
        ->id() => [
        'title' => $this
          ->t('Define the view override for the vocabulary %vocabulary', [
          '%vocabulary' => $vocabulary
            ->label(),
        ]),
      ],
    ];
    $permissions += [
      'define view for terms in ' . $vocabulary
        ->id() => [
        'title' => $this
          ->t('Define the view override for terms in %vocabulary', [
          '%vocabulary' => $vocabulary
            ->label(),
        ]),
      ],
    ];
  }
  return $permissions;
}