public function BetterFormatsPermissions::permissions in Better Formats 8
Returns an array of better formats permissions.
Return value
array
1 string reference to 'BetterFormatsPermissions::permissions'
File
- src/
BetterFormatsPermissions.php, line 46
Class
- BetterFormatsPermissions
- Provides dynamic permissions of the better formats module.
Namespace
Drupal\better_formatsCode
public function permissions() {
$permissions = [];
// Generate permissions for each entity type.
foreach ($this->entityTypeManager
->getDefinitions() as $entity_type_id => $entity_type) {
if ($entity_type
->get('field_ui_base_route')) {
$permissions['hide format selection for ' . $entity_type_id] = [
'title' => $this
->t('Hide format selection for @label', [
'@label' => $entity_type
->getLabel(),
]),
];
}
}
return $permissions;
}