diff options
| author | Raphael Michel <mail@raphaelmichel.de> | 2015-06-05 10:08:19 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-06-08 13:44:39 -0400 |
| commit | 39937de7e60052d3ffa9f07fdbb9262aced35d61 (patch) | |
| tree | a49b4fd14a34fb0c68825f978031d56b390fe350 /docs | |
| parent | 8b1f39a727be91aab40bdb37235718ed63ae1d50 (diff) | |
Fixed #24929 -- Allowed permission_required decorator to take any iterable
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.9.txt | 4 | ||||
| -rw-r--r-- | docs/topics/auth/default.txt | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index a3fb56c6c0..55906864ef 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -114,6 +114,10 @@ Minor features a deprecation warning in older versions and is no longer supported in Django 1.9). +* The permission argument of + :func:`~django.contrib.auth.decorators.permission_required()` accepts all + kinds of iterables, not only list and tuples. + :mod:`django.contrib.gis` ^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<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 |
