Make 'add/change/delete collection' permission configurable on group edit page

pull/4163/merge
Matt Westcott 2017-11-21 15:56:34 +00:00
rodzic 8c0b9b0bc1
commit 95b394e5e5
3 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -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)

Wyświetl plik

@ -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

Wyświetl plik

@ -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']
)