mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
Job Template form 'can_edit'
the 'Save' button should be disabled if the user does not have sufficient permissions to edit the job template
This commit is contained in:
parent
f62b9ff2c0
commit
f7706c3808
@ -334,7 +334,7 @@ angular.module('JobTemplateFormDefinition', ['SchedulesListDefinition', 'Complet
|
||||
buttons: { //for now always generates <button> tags
|
||||
save: {
|
||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||
ngDisabled: true //Disable when $pristine or $invalid, optional
|
||||
ngDisabled: "job_templates_form.$invalid || can_edit!==true"//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
|
||||
},
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
|
||||
@ -141,6 +141,8 @@ angular.module('JobTemplatesHelper', ['Utilities'])
|
||||
GetBasePath('job_templates') + id + '/callback/');
|
||||
master.callback_url = scope.callback_url;
|
||||
|
||||
scope.can_edit = data.summary_fields.can_edit;
|
||||
|
||||
LookUpInit({
|
||||
scope: scope,
|
||||
form: form,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user