Package django :: Package contrib :: Package auth :: Module decorators
[hide private]
[frames] | no frames]

Module decorators

source code

Classes [hide private]
  _CheckLogin
Class that checks that the user passes the given test, redirecting to the log-in page if necessary.
Functions [hide private]
 
user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME)
Decorator for views that checks that the user passes the given test, redirecting to the log-in page if necessary.
source code
 
login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME)
Decorator for views that checks that the user is logged in, redirecting to the log-in page if necessary.
source code
 
permission_required(perm, login_url=None)
Decorator for views that checks whether a user has a particular permission enabled, redirecting to the log-in page if necessary.
source code

Imports: REDIRECT_FIELD_NAME, HttpResponseRedirect, urlquote


Function Details [hide private]

user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME)

source code 

Decorator for views that checks that the user passes the given test, redirecting to the log-in page if necessary. The test should be a callable that takes the user object and returns True if the user passes.