/usr/lib/python2.7/dist-packages/hijack/settings.py is in python-django-hijack 2.0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | # -*- coding: utf-8 -*-
from django.conf import settings as django_settings
SETTINGS = (
{
'name': 'HIJACK_DISPLAY_ADMIN_BUTTON',
'default': True,
'legacy_name': 'SHOW_HIJACKUSER_IN_ADMIN',
},
{
'name': 'HIJACK_DISPLAY_WARNING',
'default': True,
'legacy_name': 'HIJACK_NOTIFY_ADMIN',
},
{
'name': 'HIJACK_URL_ALLOWED_ATTRIBUTES',
'default': ('user_id', 'email', 'username'),
'legacy_name': 'ALLOWED_HIJACKING_USER_ATTRIBUTES',
},
{
'name': 'HIJACK_AUTHORIZE_STAFF',
'default': False,
'legacy_name': 'ALLOW_STAFF_TO_HIJACKUSER',
},
{
'name': 'HIJACK_AUTHORIZE_STAFF_TO_HIJACK_STAFF',
'default': False,
'legacy_name': 'ALLOW_STAFF_TO_HIJACK_STAFF_USER',
},
{
'name': 'HIJACK_LOGIN_REDIRECT_URL',
'default': getattr(django_settings, 'LOGIN_REDIRECT_URL', '/'),
'legacy_name': None,
},
{
'name': 'HIJACK_LOGOUT_REDIRECT_URL',
'default': getattr(django_settings, 'LOGIN_REDIRECT_URL', '/'),
'legacy_name': 'REVERSE_HIJACK_LOGIN_REDIRECT_URL',
},
{
'name': 'HIJACK_AUTHORIZATION_CHECK',
'default': 'hijack.helpers.is_authorized_default',
'legacy_name': 'CUSTOM_HIJACK_HANDLER',
},
{
'name': 'HIJACK_DECORATOR',
'default': 'django.contrib.admin.views.decorators.staff_member_required',
'legacy_name': None,
},
{
'name': 'HIJACK_USE_BOOTSTRAP',
'default': False,
'legacy_name': None,
},
)
for setting in SETTINGS:
if setting['legacy_name']:
default = getattr(django_settings, setting['legacy_name'], setting['default'])
else:
default = setting['default']
value = getattr(django_settings, setting['name'], default)
globals()[setting['name']] = value
|