mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 19:20:05 -03:30
Simplified and fixed save button permissions
This commit is contained in:
@@ -157,8 +157,8 @@ export default [
|
|||||||
}
|
}
|
||||||
addFieldInfo(form, key);
|
addFieldInfo(form, key);
|
||||||
});
|
});
|
||||||
// Disable the save button for non-superusers
|
// Disable the save button for system auditors
|
||||||
form.buttons.save.disabled = 'vm.updateProhibited';
|
form.buttons.save.disabled = $rootScope.user_is_system_auditor;
|
||||||
});
|
});
|
||||||
|
|
||||||
function addFieldInfo(form, key) {
|
function addFieldInfo(form, key) {
|
||||||
|
|||||||
@@ -465,11 +465,6 @@ export default [
|
|||||||
triggerModal(msg, title, buttons);
|
triggerModal(msg, title, buttons);
|
||||||
};
|
};
|
||||||
|
|
||||||
var updateProhibited = true;
|
|
||||||
if($rootScope.user_is_superuser) {
|
|
||||||
updateProhibited = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
angular.extend(vm, {
|
angular.extend(vm, {
|
||||||
activeTab: activeTab,
|
activeTab: activeTab,
|
||||||
activeTabCheck: activeTabCheck,
|
activeTabCheck: activeTabCheck,
|
||||||
@@ -482,7 +477,6 @@ export default [
|
|||||||
resetAllConfirm: resetAllConfirm,
|
resetAllConfirm: resetAllConfirm,
|
||||||
show_auditor_bar: show_auditor_bar,
|
show_auditor_bar: show_auditor_bar,
|
||||||
triggerModal: triggerModal,
|
triggerModal: triggerModal,
|
||||||
updateProhibited: updateProhibited
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ export default [
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Disable the save button for non-superusers
|
// Disable the save button for system auditors
|
||||||
form.buttons.save.disabled = 'vm.updateProhibited';
|
form.buttons.save.disabled = $rootScope.user_is_system_auditor;
|
||||||
|
|
||||||
var keys = _.keys(form.fields);
|
var keys = _.keys(form.fields);
|
||||||
_.each(keys, function(key) {
|
_.each(keys, function(key) {
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ export default [
|
|||||||
addFieldInfo(form, key);
|
addFieldInfo(form, key);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Disable the save button for non-superusers
|
// Disable the save button for system auditors
|
||||||
form.buttons.save.disabled = 'vm.updateProhibited';
|
form.buttons.save.disabled = $rootScope.user_is_system_auditor;
|
||||||
|
|
||||||
function addFieldInfo(form, key) {
|
function addFieldInfo(form, key) {
|
||||||
_.extend(form.fields[key], {
|
_.extend(form.fields[key], {
|
||||||
|
|||||||
@@ -47,8 +47,8 @@
|
|||||||
addFieldInfo(form, key);
|
addFieldInfo(form, key);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Disable the save button for non-superusers
|
// Disable the save button for system auditors
|
||||||
form.buttons.save.disabled = 'vm.updateProhibited';
|
form.buttons.save.disabled = $rootScope.user_is_system_auditor;
|
||||||
|
|
||||||
function addFieldInfo(form, key) {
|
function addFieldInfo(form, key) {
|
||||||
_.extend(form.fields[key], {
|
_.extend(form.fields[key], {
|
||||||
|
|||||||
Reference in New Issue
Block a user