Set CREATE_USER_FUNC and API_PERMISSIONS when using LDAP
This commit is contained in:
parent
b0f888f236
commit
e09d5f1723
@ -139,6 +139,10 @@ STATIC_ROOT = os.environ.get('DJANGO_STATIC_ROOT', os.path.join(BASE_DIR, 'stati
|
|||||||
MEDIA_ROOT = os.environ.get('DJANGO_MEDIA_ROOT', os.path.join(BASE_DIR, 'media'))
|
MEDIA_ROOT = os.environ.get('DJANGO_MEDIA_ROOT', os.path.join(BASE_DIR, 'media'))
|
||||||
MEDIA_URL = '/user-media/'
|
MEDIA_URL = '/user-media/'
|
||||||
|
|
||||||
|
ETEBASE_API_PERMISSIONS = ['rest_framework.permissions.IsAuthenticated']
|
||||||
|
ETEBASE_API_AUTHENTICATORS = ('django_etebase.token_auth.authentication.TokenAuthentication',
|
||||||
|
'rest_framework.authentication.SessionAuthentication')
|
||||||
|
ETEBASE_CREATE_USER_FUNC = 'django_etebase.utils.create_user_blocked'
|
||||||
|
|
||||||
# Define where to find configuration files
|
# Define where to find configuration files
|
||||||
config_locations = ['etebase-server.ini', '/etc/etebase-server/etebase-server.ini']
|
config_locations = ['etebase-server.ini', '/etc/etebase-server/etebase-server.ini']
|
||||||
@ -172,10 +176,9 @@ if any(os.path.isfile(x) for x in config_locations):
|
|||||||
LDAP_BIND_DN = ldap.get('bind_dn', '')
|
LDAP_BIND_DN = ldap.get('bind_dn', '')
|
||||||
LDAP_BIND_PW = ldap.get('bind_pw', '')
|
LDAP_BIND_PW = ldap.get('bind_pw', '')
|
||||||
|
|
||||||
ETEBASE_API_PERMISSIONS = ('rest_framework.permissions.IsAuthenticated', )
|
# Configure EteBase to use LDAP
|
||||||
ETEBASE_API_AUTHENTICATORS = ('django_etebase.token_auth.authentication.TokenAuthentication',
|
ETEBASE_CREATE_USER_FUNC = 'myauth.ldap.create_user'
|
||||||
'rest_framework.authentication.SessionAuthentication')
|
ETEBASE_API_PERMISSIONS.append('myauth.ldap.LDAPUserExists')
|
||||||
ETEBASE_CREATE_USER_FUNC = 'django_etebase.utils.create_user_blocked'
|
|
||||||
|
|
||||||
# Make an `etebase_server_settings` module available to override settings.
|
# Make an `etebase_server_settings` module available to override settings.
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user