Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Uiscripts.context.user.role comes back "undefined"


Hi guys,

I’m attempting to check if a specific role exists in order to show / hide a button on the Suites overview page. Unfortunately the “role” field comes back as “undefined”.

The following all return valid data:


Hello Glenn,

Thanks for your posting. This should be ‘role_id’ actually and I’ve just updated the documentation. The role_id refers to the database ID of the role and not the actual name, so you would need to look up the IDs in the administration area under Administration > User & Roles (just hover your mouse over the edit link and the ID is then part of the link URL).

I hope this helps and please let me know in case you have any further questions.



Hi Tobias,

That worked, thanks :slight_smile: