mirror of
https://github.com/ansible/awx.git
synced 2026-03-08 21:19:26 -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')) {
|
||||
vm.inputSources.items = credential.get('related.input_sources.results');
|
||||
}
|
||||
vm.isTestable = (isEditable && credentialType.get('kind') === 'external');
|
||||
|
||||
if (mode === 'add') {
|
||||
vm.isTestable = (models.me.get('is_superuser') && credentialType.get('kind') === 'external');
|
||||
} else {
|
||||
vm.isTestable = (isEditable && credentialType.get('kind') === 'external');
|
||||
}
|
||||
|
||||
vm.getSubmitData = getSubmitData;
|
||||
vm.checkForm = check;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user