Same name in other branches
- 8.x-1.x src/EntityClonePermissions.php \Drupal\entity_clone\EntityClonePermissions::permissions()
Returns an array of entity_clone permissions.
Return value
array The permission list.
1 string reference to 'EntityClonePermissions::permissions'
File
-
src/
EntityClonePermissions.php, line 70
Class
- EntityClonePermissions
- Provides dynamic permissions of the entity_clone module.
Namespace
Drupal\entity_cloneCode
public function permissions() {
$permissions = [];
foreach ($this->entityTypeManager
->getDefinitions() as $entity_type_id => $entity_type) {
$permissions['clone ' . $entity_type_id . ' entity'] = $this->translationManager
->translate('Clone all <em>@label</em> entities.', [
'@label' => $entity_type->getLabel(),
]);
if ($this->serviceProvider
->entityTypeHasOwnerTrait($entity_type)) {
$permissions['take_ownership_on_clone ' . $entity_type_id . ' entity'] = $this->translationManager
->translate('Allow user to take ownership of <em>@label</em> cloned entities', [
'@label' => $entity_type->getLabel(),
]);
}
}
return $permissions;
}