You are here

public static function VpprPermissions::permissions in Vocabulary Permissions Per Role 8

Defines permissions related to vppr.

1 call to VpprPermissions::permissions()
vppr_access in ./vppr.module
Access callback for common VPPR taxonomy operations.
1 string reference to 'VpprPermissions::permissions'
vppr.permissions.yml in ./vppr.permissions.yml
vppr.permissions.yml

File

src/VpprPermissions.php, line 47

Class

VpprPermissions
Class VpprPermissions.

Namespace

Drupal\vppr

Code

public static function permissions() {
  $perms = [];
  $names = taxonomy_vocabulary_get_names();
  $vocabularies = Vocabulary::loadMultiple($names);
  foreach ($vocabularies as $vocabulary) {
    $perms['administer ' . $vocabulary
      ->id() . ' vocabulary terms'] = [
      'title' => t('Administer %name vocabulary terms', [
        '%name' => $vocabulary
          ->label(),
        '%vid' => $vocabulary
          ->id(),
      ]),
    ];
  }
  return $perms;
}