Hi,
How to check in server-side whether the logged-in user has got a specific role, e.g “HR Manager”?
Hi,
How to check in server-side whether the logged-in user has got a specific role, e.g “HR Manager”?
you can use frappe.get_roles() to get roles of logged-in user and make condition like this:
if ‘HR Manager’ in frappe.get_roles():
print(“user has permission”)