ERPNext Conference 2019* Blog

Get user roles in controllers


Hi, in my i want to add validate by the roles, how i can do this? how i can get the roles?



Try frappe.get_roles() to get the roles of the current user.


How do we do the same in client side?
and how can we check for a specific role for logged in user in client side?


okey Found it .



frappe.user.has_role(“Role”) will fetch all the users with role Role? Isn’t working for me.


Just to update, it is now frappe.user_roles in “Frappe Framework: v11.1.44 (master)” version