You could show/hide the buttons based on the user. I use this code to hide buttons I don’t want my general users to access. I think there’s also a frappe.get_roles() function, but I haven’t used this.
// Hide based on user type --------------------------------------
var isAdmin = frappe.session.user == 'Administrator'; // Identify if user is Administrator
if (isAdmin) {
// Show button for Admin
frm.add_custom_button(__("console.log"), function () {
console.log(frm);
});
}