Restrict Import XML Context Menu on Prod Instances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi,
I have been trying to restrict the visibility of 'Import XML' Context button on Prod Instances, I have tried to modify the condition on the Context Menu to below but the button seems to be visible to all 'admin' Users.
I have tried to break it down for all 3 scenarios, neither of them seem to work.
- All the conditions
- User has role of 'import_admin_xml'
- Instance is 'xxxxxdev'
I have further tried to update the System Property 'glide.ui.admin_import_xml_roles' value from 'admin' to 'import_admin_xml'. without any luck.
Has anyone implemented this before or have any advice on how I could achieve it? Thanks in advance!!!
//Initial Condition
(gs.hasRightsTo("ui/context_menu.import_xml/read", null) && !ListProperties.isRelatedList() && !ListProperties.isRefList() &&!ListProperties.isRemoteTable() && (gs.hasRole('import_admin_xml'))) || (gs.getProperty('instance_name') == 'xxxxxxxdev')
//Role Condition Only
gs.hasRole("import_admin_xml")
//Instance Condition Only
gs.getProperty('instance_name') == 'xxxxxxxdev'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Check if you can use property glide.ui.security.upload.roles to limit the roles that can import XML files. You can create a new role and only if that role is assigned to user, they can import XML using the property.
Refer below thread for reference
https://www.servicenow.com/community/developer-forum/issue-with-import-xml/m-p/2153277
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan