Hi, in my som_modules.py i want to add validate by the roles, how i can do this? how i can get the roles?
Thanks
Hi, in my som_modules.py i want to add validate by the roles, how i can do this? how i can get the roles?
Thanks
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”)
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
frappe.user_roles.includes("<Your Role>")
This will return true if the user has <Your Role>
.
This will work on client side.
This is not working
I need to get user roles in portal page.How can I get the roles in portal pages?