Please help me on how to get this logic "gs.hasRightsTo("ui/context_menu.show_xml/read", null) "

rajalakshmi12
Mega Expert

Please help me on how to get this logic "gs.hasRightsTo("ui/context_menu.show_xml/read", null) " to check whether the user has access to this Context menu.

Thank you.

find_real_file.png

2 REPLIES 2

The SN Nerd
Giga Sage
Giga Sage

I'm pretty sure that is analogous to

gs.hasRole('admin')

ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

pawel_staszewsk
Giga Guru

Hi.

This is ACL check

But it is old, so is not working with new releases and gives access only to role 'admin'

The ACL type 'ui' does not exist anymore.

You may change type to 'ui_page' like:

gs.hasRightsTo("ui_page/context_menu.show_xml/read", null) [...]

and create ACL with type 'ui_page', operation 'read' and name 'context_menu.show_xml'

Once you get ACL created you can manage access like to other resources, e.g. record.

 

See also:

https://community.servicenow.com/community?id=community_question&sys_id=b3b00b65db98dbc01dcaf3231f96...

Regards,

Pawel.