restricted deletion access to system manager
This commit is contained in:
parent
7c0a83aedd
commit
9bd09b95d9
1 changed files with 11 additions and 10 deletions
|
|
@ -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();
|
||||
}});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue