restricted deletion access to system manager

This commit is contained in:
Mangesh-Khairnar 2019-02-01 17:12:43 +05:30
parent 7c0a83aedd
commit 9bd09b95d9

View file

@ -2,16 +2,17 @@
// For license information, please see license.txt
frappe.ui.form.on('Personal Data Delete Request', {
setup: function(frm) {
frm.set_query("User", "email", function() {
return {
filters: {
"email": ("not in", ["Administrator", "Guest"]),
}
}
});
},
refresh: function(frm) {
if(frappe.user.has_role('System Manager') && frm.doc.status == 'Pending Approval'){
frm.add_custom_button(__('Process Deletion'), function() {
return frappe.call({
doc: frm.doc,
method: 'anonymize_data',
freeze: true,
callback: function() {
frm.refresh();
}});
});
}
}
});