mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
Move license checking logic to /api/v2/config
Use license_info.features.ldap & license_info.feature.enterprise_auth from /api/v2/config for auth providers button enabling instead of using info from /api/v2/settings/all Signed-off-by: Julen Landa Alustiza <julen@zokormazo.info>
This commit is contained in:
parent
6b7126ab6b
commit
9c2cf6b7ca
@ -100,7 +100,7 @@ export default ['i18n', function(i18n) {
|
||||
},
|
||||
save: {
|
||||
ngClick: 'vm.formSave()',
|
||||
ngDisabled: "license_type !== 'enterprise' && license_type !== 'open' || configuration_ldap_template_form.$invalid || configuration_ldap_template_form.$pending"
|
||||
ngDisabled: "!ldap_auth || configuration_ldap_template_form.$invalid || configuration_ldap_template_form.$pending"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -39,7 +39,7 @@ export default ['i18n', function(i18n) {
|
||||
},
|
||||
save: {
|
||||
ngClick: 'vm.formSave()',
|
||||
ngDisabled: "license_type !== 'enterprise' && license_type !== 'open' || configuration_radius_template_form.$invalid || configuration_radius_template_form.$pending"
|
||||
ngDisabled: "!enterprise_auth || configuration_radius_template_form.$invalid || configuration_radius_template_form.$pending"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -92,7 +92,7 @@ export default ['i18n', function(i18n) {
|
||||
},
|
||||
save: {
|
||||
ngClick: 'vm.formSave()',
|
||||
ngDisabled: "license_type !== 'enterprise' && license_type !== 'open' || configuration_saml_template_form.$invalid || configuration_saml_template_form.$pending"
|
||||
ngDisabled: "!enterprise_auth || configuration_saml_template_form.$invalid || configuration_saml_template_form.$pending"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -52,7 +52,7 @@ export default ['i18n', function(i18n) {
|
||||
},
|
||||
save: {
|
||||
ngClick: 'vm.formSave()',
|
||||
ngDisabled: "license_type !== 'enterprise' && license_type !== 'open' || configuration_tacacs_template_form.$invalid || configuration_tacacs_template_form.$pending"
|
||||
ngDisabled: "!enterprise_auth || configuration_tacacs_template_form.$invalid || configuration_tacacs_template_form.$pending"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
export default [
|
||||
'$scope', '$rootScope', '$state', '$stateParams', '$timeout', '$q', 'Alert',
|
||||
'ConfigurationService', 'ConfigurationUtils', 'CreateDialog', 'CreateSelect2', 'i18n', 'ParseTypeChange', 'ProcessErrors', 'Store',
|
||||
'Wait', 'configDataResolve', 'ToJSON',
|
||||
'Wait', 'configDataResolve', 'ToJSON', 'ConfigService',
|
||||
//Form definitions
|
||||
'configurationAzureForm',
|
||||
'configurationGithubForm',
|
||||
@ -26,7 +26,7 @@ export default [
|
||||
function(
|
||||
$scope, $rootScope, $state, $stateParams, $timeout, $q, Alert,
|
||||
ConfigurationService, ConfigurationUtils, CreateDialog, CreateSelect2, i18n, ParseTypeChange, ProcessErrors, Store,
|
||||
Wait, configDataResolve, ToJSON,
|
||||
Wait, configDataResolve, ToJSON, ConfigService,
|
||||
//Form definitions
|
||||
configurationAzureForm,
|
||||
configurationGithubForm,
|
||||
@ -94,13 +94,6 @@ export default [
|
||||
}
|
||||
|
||||
} else {
|
||||
if (key === "LICENSE") {
|
||||
if (_.isEmpty(data[key])) {
|
||||
$scope.license_type = "open";
|
||||
} else {
|
||||
$scope.license_type = data[key].license_type;
|
||||
}
|
||||
}
|
||||
//handle nested objects
|
||||
if(ConfigurationUtils.isEmpty(data[key])) {
|
||||
$scope[key] = '{}';
|
||||
@ -114,6 +107,19 @@ export default [
|
||||
});
|
||||
$scope.$broadcast('populated', data);
|
||||
});
|
||||
ConfigService.getConfig()
|
||||
.then(function(data) {
|
||||
$scope.ldap_auth = data.license_info.features.ldap;
|
||||
$scope.enterprise_auth = data.license_info.features.enterprise_auth;
|
||||
})
|
||||
.catch(function(data, status) {
|
||||
ProcessErrors($scope, data, status, null,
|
||||
{
|
||||
hdr: i18n._('Error'),
|
||||
msg: i18n._('There was an error getting config values: ') + status
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
populateFromApi();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user