Ticket #2629: auth-decorator-permission-required.diff
File auth-decorator-permission-required.diff, 603 bytes (added by , 18 years ago) |
---|
-
django/contrib/auth/decorators.py
26 28 to the log-in page if necessary. 27 29 """ 28 30 ) 31 32 def permission_required(perm, login_url=LOGIN_URL): 33 return user_passes_test(lambda u: u.has_perm(perm), login_url=login_url) 34 permission_required.__doc__ = ( 35 """ 36 Decorator for views that checks if a user has explicit permission, 37 redirectiing to the log-in page if necessary. 38 """ 39 )