diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9e2ec487e8..1ed1b905fd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -39,6 +39,7 @@ Changelog * Added a basic Dockerfile to the project template (Tom Dyson) * StreamField blocks now allow custom `get_template` methods for overriding templates in instances (Christopher Bledsoe) * Simplified edit handler API (Florent Osmont, Bertrand Bordage) + * Made 'add/change/delete collection' permissions configurable from the group edit page (Matt Westcott) * Fix: Do not remove stopwords when generating slugs from non-ASCII titles, to avoid issues with incorrect word boundaries (Sævar Öfjörð Magnússon) * Fix: The PostgreSQL search backend now preserves ordering of the `QuerySet` when searching with `order_by_relevance=False` (Bertrand Bordage) * Fix: Using `modeladmin_register` as a decorator no longer replaces the decorated class with `None` (Tim Heap) diff --git a/docs/releases/2.0.rst b/docs/releases/2.0.rst index 14deaed9c9..ff635497b4 100644 --- a/docs/releases/2.0.rst +++ b/docs/releases/2.0.rst @@ -61,6 +61,7 @@ Other features * Added a basic Dockerfile to the project template (Tom Dyson) * StreamField blocks now allow custom ``get_template`` methods for overriding templates in instances (Christopher Bledsoe) * Simplified edit handler API (Florent Osmont, Bertrand Bordage) + * Made 'add/change/delete collection' permissions configurable from the group edit page (Matt Westcott) Bug fixes diff --git a/wagtail/core/wagtail_hooks.py b/wagtail/core/wagtail_hooks.py index 5590aa304e..1ec45c4722 100644 --- a/wagtail/core/wagtail_hooks.py +++ b/wagtail/core/wagtail_hooks.py @@ -1,4 +1,5 @@ from django.conf import settings +from django.contrib.auth.models import Permission from django.contrib.auth.views import redirect_to_login from django.urls import reverse @@ -50,3 +51,11 @@ def register_core_features(features): features.default_features.append('ol') features.default_features.append('ul') + + +@hooks.register('register_permissions') +def register_collection_permissions(): + return Permission.objects.filter( + content_type__app_label='wagtailcore', + codename__in=['add_collection', 'change_collection', 'delete_collection'] + )