Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug where users without read access on a creds org cannot edit the cred #6241

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍 ⚡

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