1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Simplified and fixed save button permissions

This commit is contained in:
Ken Hoes 2016-12-12 15:50:40 -05:00
parent 93ce2a5dfd
commit d6f1f2f22e
5 changed files with 8 additions and 14 deletions

View File

@ -157,8 +157,8 @@ export default [
}
addFieldInfo(form, key);
});
// Disable the save button for non-superusers
form.buttons.save.disabled = 'vm.updateProhibited';
// Disable the save button for system auditors
form.buttons.save.disabled = $rootScope.user_is_system_auditor;
});
function addFieldInfo(form, key) {

View File

@ -465,11 +465,6 @@ export default [
triggerModal(msg, title, buttons);
};
var updateProhibited = true;
if($rootScope.user_is_superuser) {
updateProhibited = false;
}
angular.extend(vm, {
activeTab: activeTab,
activeTabCheck: activeTabCheck,
@ -482,7 +477,6 @@ export default [
resetAllConfirm: resetAllConfirm,
show_auditor_bar: show_auditor_bar,
triggerModal: triggerModal,
updateProhibited: updateProhibited
});
}
];

View File

@ -39,8 +39,8 @@ export default [
});
});
// Disable the save button for non-superusers
form.buttons.save.disabled = 'vm.updateProhibited';
// Disable the save button for system auditors
form.buttons.save.disabled = $rootScope.user_is_system_auditor;
var keys = _.keys(form.fields);
_.each(keys, function(key) {

View File

@ -19,8 +19,8 @@ export default [
addFieldInfo(form, key);
});
// Disable the save button for non-superusers
form.buttons.save.disabled = 'vm.updateProhibited';
// Disable the save button for system auditors
form.buttons.save.disabled = $rootScope.user_is_system_auditor;
function addFieldInfo(form, key) {
_.extend(form.fields[key], {

View File

@ -47,8 +47,8 @@
addFieldInfo(form, key);
});
// Disable the save button for non-superusers
form.buttons.save.disabled = 'vm.updateProhibited';
// Disable the save button for system auditors
form.buttons.save.disabled = $rootScope.user_is_system_auditor;
function addFieldInfo(form, key) {
_.extend(form.fields[key], {