#NEWLINE# def is_authorized_default( hijacker , hijacked ) : #NEWLINE# #INDENT# 'Checks if the user has the correct permission to Hijack another user.\n\n    By default only superusers are allowed to hijack.\n\n    An exception is made to allow staff members to hijack when\n    HIJACK_AUTHORIZE_STAFF is enabled in the Django settings.\n\n    By default it prevents staff users from hijacking other staff users.\n    This can be disabled by enabling the HIJACK_AUTHORIZE_STAFF_TO_HIJACK_STAFF\n    setting in the Django settings.\n\n    Staff users can never hijack superusers.\n    ' #NEWLINE# if hijacker . is_superuser : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if hijacked . is_superuser : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( hijacker . is_staff and hijack_settings . HIJACK_AUTHORIZE_STAFF ) : #NEWLINE# #INDENT# if ( hijacked . is_staff and ( not hijack_settings . HIJACK_AUTHORIZE_STAFF_TO_HIJACK_STAFF ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# return False