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:
Jared Tabor 2014-12-10 10:36:16 -05:00
parent f62b9ff2c0
commit f7706c3808
2 changed files with 3 additions and 1 deletions

View File

@ -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()',

View File

@ -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,