How to get the current user logged in users roles using the JS api


I’m trying to do some filtering on a doctype list and need to grab the currently logged in users role to do so. I have tried the solution here but it doesn’t work and using frappe.user_roles seems to give me all the roles i have in my app. PS i’m signed in as the Administrator

frappe.user_roles does NOT give all roles, in my installation.
I guess admin has all roles, or some special handling for roles.

did you try with a “normal” user?

1 Like

It should work please check below attached

1 Like

thanks i tried a normal user and it works fine, Much appriciated

Thanks it works