Skip to content

Commit 7e59940

Browse files
author
Maxime Pahud
committed
Add collection_permission for Content Entity templates
1 parent 984dd69 commit 7e59940

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

templates/Entity/_content-entity/model.permissions.yml.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
title: 'Administer {{ entity_type_label|lower|pluralize }}'
77
{% endif %}
88
restrict access: true
9+
access {{ entity_type_label|lower }} overview:
10+
title: 'Access {{ entity_type_label|lower }} overview'
911
{% if access_controller %}
1012
{{ permissions.view }}:
1113
title: 'View {{ entity_type_label|lower }}'

templates/Entity/_content-entity/src/Entity/Example.php.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ use Drupal\{{ machine_name }}\{{ class }}AccessControlHandler;
101101
{% endif %}
102102
],
103103
],
104+
collection_permission: 'access {{ entity_type_id }} overview',
104105
links: [
105106
'collection' => '/admin/content/{{ entity_type_id_short|u2h }}',
106107
{% if bundle %}

0 commit comments

Comments
 (0)