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:
parent
93ce2a5dfd
commit
d6f1f2f22e
@ -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) {
|
||||
|
@ -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
|
||||
});
|
||||
}
|
||||
];
|
||||
|
@ -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) {
|
||||
|
@ -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], {
|
||||
|
@ -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], {
|
||||
|
Loading…
Reference in New Issue
Block a user