mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 13:57:39 -02:30
Fixes bug where user with edit permissions on a credential but no permissions on the credentials org would be denied access to the form in the UI.
This commit is contained in:
@@ -72,7 +72,7 @@ function AddEditCredentialsController (
|
|||||||
vm.form.credential_type._displayValue = credentialType.get('name');
|
vm.form.credential_type._displayValue = credentialType.get('name');
|
||||||
vm.isTestable = (isEditable && credentialType.get('kind') === 'external');
|
vm.isTestable = (isEditable && credentialType.get('kind') === 'external');
|
||||||
|
|
||||||
if (credential.get('related.input_sources.results.length' > 0)) {
|
if (credential.get('related.input_sources.results').length > 0) {
|
||||||
vm.form.credential_type._disabled = true;
|
vm.form.credential_type._disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ function CredentialsResolve (
|
|||||||
return $q.all(promises)
|
return $q.all(promises)
|
||||||
.then(models => {
|
.then(models => {
|
||||||
const typeId = models.credential.get('credential_type');
|
const typeId = models.credential.get('credential_type');
|
||||||
const orgId = models.credential.get('organization');
|
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('credentials'));
|
Rest.setUrl(GetBasePath('credentials'));
|
||||||
const params = { target_input_sources__target_credential: id };
|
const params = { target_input_sources__target_credential: id };
|
||||||
@@ -48,7 +47,9 @@ function CredentialsResolve (
|
|||||||
|
|
||||||
const dependents = {
|
const dependents = {
|
||||||
credentialType: new CredentialType('get', typeId),
|
credentialType: new CredentialType('get', typeId),
|
||||||
organization: new Organization('get', orgId),
|
organization: new Organization('get', {
|
||||||
|
resource: models.credential.get('summary_fields.organization')
|
||||||
|
}),
|
||||||
credentialInputSources: models.credential.extend('GET', 'input_sources'),
|
credentialInputSources: models.credential.extend('GET', 'input_sources'),
|
||||||
sourceCredentials: sourceCredentialsPromise
|
sourceCredentials: sourceCredentialsPromise
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user