From 7e5994032340b49489d2143b714b4a09e832356c Mon Sep 17 00:00:00 2001 From: Maxime Pahud Date: Fri, 20 Jun 2025 14:44:05 +0200 Subject: [PATCH] Add collection_permission for Content Entity templates --- templates/Entity/_content-entity/model.permissions.yml.twig | 2 ++ templates/Entity/_content-entity/src/Entity/Example.php.twig | 1 + 2 files changed, 3 insertions(+) diff --git a/templates/Entity/_content-entity/model.permissions.yml.twig b/templates/Entity/_content-entity/model.permissions.yml.twig index 6e0d9e08..79428e17 100644 --- a/templates/Entity/_content-entity/model.permissions.yml.twig +++ b/templates/Entity/_content-entity/model.permissions.yml.twig @@ -6,6 +6,8 @@ title: 'Administer {{ entity_type_label|lower|pluralize }}' {% endif %} restrict access: true +access {{ entity_type_label|lower }} overview: + title: 'Access {{ entity_type_label|lower }} overview' {% if access_controller %} {{ permissions.view }}: title: 'View {{ entity_type_label|lower }}' diff --git a/templates/Entity/_content-entity/src/Entity/Example.php.twig b/templates/Entity/_content-entity/src/Entity/Example.php.twig index d7af8893..fd1e9551 100644 --- a/templates/Entity/_content-entity/src/Entity/Example.php.twig +++ b/templates/Entity/_content-entity/src/Entity/Example.php.twig @@ -101,6 +101,7 @@ use Drupal\{{ machine_name }}\{{ class }}AccessControlHandler; {% endif %} ], ], + collection_permission: 'access {{ entity_type_id }} overview', links: [ 'collection' => '/admin/content/{{ entity_type_id_short|u2h }}', {% if bundle %}