Allow non-admin users to use the Show XML context menu

brenthubin
Tera Contributor

I'm trying to allow a role called 'integrator' to have access to the 'Show XML' context menu. I've copied the 'Show XML' context menu rule and set the condition to (gs.hasRole('integrator')); but it still isn't showing up in the dropdown when one of the users right clicks on the header. Can anyone help me find what I'm missing?

find_real_file.png

7 REPLIES 7

Lindsey6
Giga Contributor

I also have the same question about allowing a particular 'role' access to the "Show XML", but I do not see the context_form_header. Would it be listed under something different in London?

pawel_staszewsk
Giga Guru

"Show XML" has two flavors.

One is on list context menu (System UI -> UI Context Menu -> Show XML)

/sys_ui_context_menu.do?sys_id=d175b50d0a0a0b3e002a9f1656c89d22

 second on details page (System UI -> UI Macros -> context_form_header)

/sys_ui_macro.do?sys_id=2ff1c56ca9fe3dba014340c4697b5088

The "Context Menu" has condition which includes 'hasRightsTo()' - ACL check. It can be easily changed to hasRole().

The UI Macro has at the top of the code access variable:

<g2:evaluate var="jvar_context_menu_show_xml" expression="gs.hasRightsTo('ui/context_menu.show_xml/read', null)" />

I am not as long with SNOW as this code, but we have no more 'ui' type of ACL.

If you update ACL type to 'ui_page', or change the line to use role check instead of ACL, it will work fine (London).

<g2:evaluate var="jvar_context_menu_show_xml" expression="gs.hasRightsTo('ui_page/context_menu.show_xml/read', null)" />
<g2:evaluate var="jvar_context_menu_show_xml" expression="gs.hasRole('itil')" />

Of course ACL type 'ui_page' with operation 'read' and name 'context_menu.show_xml' need to be created with elevated privileges.

find_real_file.png

Have fun.

Brent L_2
Tera Contributor

Great post.  Made the changes and it is working in San Diego Release.