1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 06:51:10 +03:00

Merge pull request #211 from jangsutsr/fix_114

Add Tower Configuration setting AUTH_LDAP_GROUP_TYPE_MEMBER_ATTR
This commit is contained in:
Aaron Tan 2017-09-19 13:28:30 -04:00 committed by GitHub
commit ee762d4bbd
2 changed files with 13 additions and 1 deletions

View File

@ -293,6 +293,17 @@ register(
default='MemberDNGroupType',
)
register(
'AUTH_LDAP_GROUP_TYPE_MEMBER_ATTR',
field_class=fields.CharField,
default='member',
label=_('LDAP Group Type Member Attribute'),
help_text=_('Specify member_attr when AUTH_LDAP_GROUP_TYPE=MemberDNGroupType.'),
category=_('LDAP'),
category_slug='ldap',
feature_required='ldap',
)
register(
'AUTH_LDAP_REQUIRE_GROUP',
field_class=fields.LDAPDNField,

View File

@ -323,7 +323,8 @@ class LDAPGroupTypeField(fields.ChoiceField):
if not data:
return None
if data.endswith('MemberDNGroupType'):
return getattr(django_auth_ldap.config, data)(member_attr='member')
from django.conf import settings
return getattr(django_auth_ldap.config, data)(member_attr=settings.AUTH_LDAP_GROUP_TYPE_MEMBER_ATTR)
else:
return getattr(django_auth_ldap.config, data)()