mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 18:20:00 -03:30
Merge pull request #4659 from jakemcdermott/fix-4658
Disable edit mode cred form unless edit capability is true
This commit is contained in:
@@ -29,6 +29,7 @@ function AddEditCredentialsController (
|
|||||||
const isExternal = credentialType.get('kind') === 'external';
|
const isExternal = credentialType.get('kind') === 'external';
|
||||||
const mode = $state.current.name.startsWith('credentials.add') ? 'add' : 'edit';
|
const mode = $state.current.name.startsWith('credentials.add') ? 'add' : 'edit';
|
||||||
|
|
||||||
|
vm.isEditable = credential.get('summary_fields.user_capabilities.edit');
|
||||||
vm.mode = mode;
|
vm.mode = mode;
|
||||||
vm.strings = strings;
|
vm.strings = strings;
|
||||||
|
|
||||||
@@ -52,6 +53,7 @@ function AddEditCredentialsController (
|
|||||||
vm.form = credential.createFormSchema({ omit });
|
vm.form = credential.createFormSchema({ omit });
|
||||||
vm.form.disabled = !isEditable;
|
vm.form.disabled = !isEditable;
|
||||||
}
|
}
|
||||||
|
vm.form.disabled = !vm.isEditable;
|
||||||
|
|
||||||
vm.form._organization._disabled = !isOrgEditableByUser;
|
vm.form._organization._disabled = !isOrgEditableByUser;
|
||||||
// Only exists for permissions compatibility
|
// Only exists for permissions compatibility
|
||||||
|
|||||||
Reference in New Issue
Block a user