mirror of
https://github.com/ansible/awx.git
synced 2026-07-02 03:48:02 -02:30
Basic License feature gating changes
This commit is contained in:
@@ -25,7 +25,6 @@ from awx.sso.ldap_group_types import PosixUIDGroupType # noqa
|
||||
|
||||
# Tower
|
||||
from awx.conf import fields
|
||||
from awx.conf.license import feature_enabled
|
||||
from awx.main.validators import validate_certificate
|
||||
from awx.sso.validators import ( # noqa
|
||||
validate_ldap_dn,
|
||||
@@ -164,13 +163,12 @@ class AuthenticationBackendsField(fields.StringListField):
|
||||
except AttributeError:
|
||||
backends = self.REQUIRED_BACKEND_SETTINGS.keys()
|
||||
# Filter which authentication backends are enabled based on their
|
||||
# required settings being defined and non-empty. Also filter available
|
||||
# backends based on license features.
|
||||
# required settings being defined and non-empty.
|
||||
for backend, required_settings in self.REQUIRED_BACKEND_SETTINGS.items():
|
||||
if backend not in backends:
|
||||
continue
|
||||
required_feature = self.REQUIRED_BACKEND_FEATURE.get(backend, '')
|
||||
if not required_feature or feature_enabled(required_feature):
|
||||
if not required_feature:
|
||||
if all([getattr(settings, rs, None) for rs in required_settings]):
|
||||
continue
|
||||
backends = [x for x in backends if x != backend]
|
||||
@@ -782,4 +780,3 @@ class SAMLTeamAttrField(BaseDictWithChildField):
|
||||
'remove': fields.BooleanField(required=False),
|
||||
'saml_attr': fields.CharField(required=False, allow_null=True),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user