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:
commit
ee762d4bbd
@ -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,
|
||||
|
@ -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)()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user