From 39937de7e60052d3ffa9f07fdbb9262aced35d61 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 5 Jun 2015 10:08:19 +0200 Subject: Fixed #24929 -- Allowed permission_required decorator to take any iterable --- docs/topics/auth/default.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/topics/auth') diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt index 2df53816de..9e2d549fd1 100644 --- a/docs/topics/auth/default.txt +++ b/docs/topics/auth/default.txt @@ -580,7 +580,7 @@ The permission_required decorator (i.e. ``polls.can_vote`` for a permission on a model in the ``polls`` application). - The decorator may also take a list of permissions. + The decorator may also take an iterable of permissions. Note that :func:`~django.contrib.auth.decorators.permission_required()` also takes an optional ``login_url`` parameter. Example:: @@ -599,6 +599,11 @@ The permission_required decorator (HTTP Forbidden) view` instead of redirecting to the login page. + .. versionchanged:: 1.9 + + In older versions, the ``permission`` parameter only worked with + strings, lists, and tuples instead of strings and any iterable. + .. _applying-permissions-to-generic-views: Applying permissions to generic views -- cgit v1.3