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

Conversation

mabashian
Copy link
Member

@mabashian mabashian commented Mar 10, 2020

SUMMARY

What was happening here was that a request was being made in the resolve block for the edit state that would go out and fetch the organization. This request failed and we were falling into a catch which threw an error and stopped the transition to the state.

We actually don't need to go out and fetch the org - we have some basic org info in the summary_fields of the credential. These changes use the condensed object from the summary_fields to populate the model and mitigate the need for a GET.

Once I got the form rendering, I noticed that the credential type field was disabled. This was due to a syntax error when fetching input_sources from the model.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • UI

…missions on the credentials org would be denied access to the form in the UI.
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@jakemcdermott
Copy link
Contributor

recheck

@@ -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 👍 ⚡

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 356b674 into ansible:devel Mar 10, 2020
@mabashian mabashian deleted the 4085-cred-edit branch March 31, 2020 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants