mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 08:37:48 -02:30
Only show cred type test button to superusers.
Without a credential instance, plugin tests go through the credential type (not credential) api. Since this endpoint is for superusers only, we hide the test button when non-superusers are adding a new external credential.
This commit is contained in:
@@ -156,7 +156,13 @@ function AddEditCredentialsController (
|
|||||||
if (credential.get('credential_type') === credentialType.get('id')) {
|
if (credential.get('credential_type') === credentialType.get('id')) {
|
||||||
vm.inputSources.items = credential.get('related.input_sources.results');
|
vm.inputSources.items = credential.get('related.input_sources.results');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mode === 'add') {
|
||||||
|
vm.isTestable = (models.me.get('is_superuser') && credentialType.get('kind') === 'external');
|
||||||
|
} else {
|
||||||
vm.isTestable = (isEditable && credentialType.get('kind') === 'external');
|
vm.isTestable = (isEditable && credentialType.get('kind') === 'external');
|
||||||
|
}
|
||||||
|
|
||||||
vm.getSubmitData = getSubmitData;
|
vm.getSubmitData = getSubmitData;
|
||||||
vm.checkForm = check;
|
vm.checkForm = check;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user