#NEWLINE# def permission_required( permission_name ) : #NEWLINE# #INDENT# "\n    Replacement for django.contrib.auth.decorators.permission_required which returns a\n    more meaningful 'permission denied' response than just redirecting to the login page.\n    (The latter doesn't work anyway because Wagtail doesn't define LOGIN_URL...)\n    " #NEWLINE# def test( user ) : #NEWLINE# #INDENT# return user . has_perm ( permission_name ) #NEWLINE# #UNINDENT# return user_passes_test ( permission_name )