public function TaxonomyAccessFixPermissions::getPermissions in Taxonomy access fix 8.3
Same name and namespace in other branches
- 8.2 src/TaxonomyAccessFixPermissions.php \Drupal\taxonomy_access_fix\TaxonomyAccessFixPermissions::getPermissions()
Gets additional permissions for Taxonomy Vocabulary entities.
Return value
array Permissions array.
1 string reference to 'TaxonomyAccessFixPermissions::getPermissions'
File
- src/
TaxonomyAccessFixPermissions.php, line 47
Class
- TaxonomyAccessFixPermissions
- Provides additional permissions for entities provided by Taxonomy module.
Namespace
Drupal\taxonomy_access_fixCode
public function getPermissions() {
$permissions = [];
$vocabularies = $this->entityTypeManager
->getStorage('taxonomy_vocabulary')
->loadMultiple();
foreach ($vocabularies as $vocabulary) {
$permissions['view terms in ' . $vocabulary
->id()] = [
'title' => $this
->t('View terms in %vocabulary', [
'%vocabulary' => $vocabulary
->label(),
]),
];
$permissions['reorder terms in ' . $vocabulary
->id()] = [
'title' => $this
->t('Reorder terms in %vocabulary', [
'%vocabulary' => $vocabulary
->label(),
]),
];
}
return $permissions;
}