Browse files

Added 'Limiting access to generic views' section to docs/authenticati…


git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 4608384 commit 29bdbc3dbffed238546b1ea1163a95139d50236f @adrianholovaty adrianholovaty committed Nov 13, 2005
Showing with 15 additions and 0 deletions.
  1. +15 −0 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:

0 comments on commit 29bdbc3

Please sign in to comment.