Skip to content

Commit

Permalink
Merge pull request #6241 from mabashian/4085-cred-edit
Browse files Browse the repository at this point in the history
Fixes bug where users without read access on a creds org cannot edit the cred

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
  • Loading branch information
softwarefactory-project-zuul[bot] authored Mar 10, 2020
2 parents 789397d + dd5f251 commit 356b674
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function AddEditCredentialsController (
vm.form.credential_type._displayValue = credentialType.get('name');
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;
}

Expand Down
5 changes: 3 additions & 2 deletions awx/ui/client/features/credentials/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,16 @@ function CredentialsResolve (
return $q.all(promises)
.then(models => {
const typeId = models.credential.get('credential_type');
const orgId = models.credential.get('organization');

Rest.setUrl(GetBasePath('credentials'));
const params = { target_input_sources__target_credential: id };
const sourceCredentialsPromise = Rest.get({ params });

const dependents = {
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'),
sourceCredentials: sourceCredentialsPromise
};
Expand Down

0 comments on commit 356b674

Please sign in to comment.