protected function EntityPermissionProvider::buildEntityTypePermissions in Entity API 8
Builds permissions for the entity_type granularity.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.
Return value
array The permissions.
Overrides EntityPermissionProviderBase::buildEntityTypePermissions
File
- src/
EntityPermissionProvider.php, line 52
Class
- EntityPermissionProvider
- Provides generic entity permissions.
Namespace
Drupal\entityCode
protected function buildEntityTypePermissions(EntityTypeInterface $entity_type) {
$permissions = parent::buildEntityTypePermissions($entity_type);
$entity_type_id = $entity_type
->id();
$plural_label = $entity_type
->getPluralLabel();
$permissions["view {$entity_type_id}"] = [
'title' => $this
->t('View @type', [
'@type' => $plural_label,
]),
];
return $permissions;
}