Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

Client side script User Role

Hi,

i wonder can i get current user role in client side script ?..
i want to remove some unecessary buttons depends on the roles , buttons that added by js , like make invoice , make payment , etc

Thanks

Check the global user_roles

Hi,

could you give me example how to use that ?..that is for client side script right ?

@bobzz_zone why don’t you try before asking? You should be an expert by now :smile:

Hi,

Yaa, i can do alot of things already , but it will help a lot if you can gives me an example to us it because without any documentation actually i got little confused

am i just have to use like this :
doc.user_roles ?
or is that field is stored in some other variable ?

Thanks

i found it already, thanks

1 Like

Please share it too, so that someone else searching can use it.

Hi, its just js variable , so just call it in the client side like we called another global variable, but that one is an array

Can you give solution you got for this?
Please it will help a lot.