summaryrefslogtreecommitdiff
path: root/docs/authentication.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-11-13 04:48:52 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-11-13 04:48:52 +0000
commit29bdbc3dbffed238546b1ea1163a95139d50236f (patch)
tree7e4b479e2a9f665c2631154afa94baab146205e0 /docs/authentication.txt
parent46083845d4125ea6c7da66b81cd8bdd9ec6ac067 (diff)
Added 'Limiting access to generic views' section to docs/authentication.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/authentication.txt')
-rw-r--r--docs/authentication.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/authentication.txt b/docs/authentication.txt
index e813f78e11..9aa581cf13 100644
--- a/docs/authentication.txt
+++ b/docs/authentication.txt
@@ -282,6 +282,21 @@ As a shortcut, you can use the convenient ``user_passes_test`` decorator::
Note that ``user_passes_test`` does not automatically check that the ``User``
is not anonymous.
+Limiting access to generic views
+--------------------------------
+
+To limit access to a `generic view`_, write a thin wrapper around the view,
+and point your URLconf to your wrapper instead of the generic view itself.
+For example::
+
+ from django.views.generic.date_based import object_detail
+
+ @login_required
+ def limited_object_detail(*args, **kwargs):
+ return object_detail(*args, **kwargs)
+
+.. _generic view: http://www.djangoproject.com/documentation/generic_views/
+
Permissions
===========