- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2022 01:22 PM
Hi all,
I am searching for a way to hide one elevated Role under the User Menu > Elevate Roles. Does somebody know a why to do that?
I have tried modifying these UI Macros, but my changes seemingly do not apply to anything, everything stays the same.
The same is true for the UI Script "ElevatedRole" and the UI Page "elevated_role_dialog"
Thanks in advance
Karl
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2022 01:10 AM
Hi Karl,
I see you continued on this here:
I think that is a better way of approaching this as it does not require you to customize the Elevated privilege functionality.
Using a GlideRecord Query would be a good starting point. That way you can secure the field with ACL's for a regular role. And when you need the value you can use for example an on Display business rule that loads the value of that field for usage in Client scripts.
I would suggest you close this thread to more focus on your other thread. You can do this by marking the best answer as Correct. Additionally people highly appreciate it if you reward their help by marking their comments Helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2022 01:55 PM
I think this might have been related to another question you posed, but the short answer would be that there isn't an easy or configurable way to hide that option. You could potentially do it with some rather heavy DOM manipulation, but it would likely be more trouble than it would be worth.
Just in case this is not something you no longer need to pursue, what would be the value of having an elevated role assigned to a user that they can't actually engage?
I hope this helps!
If this was helpful, or correct, please be kind and mark the answer appropriately.
Michael Jones - Proud member of the GlideFast Consulting Team
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2022 12:08 AM
Yes I need it to access a field which is normally unaccessable to all users, in some client scripts and catalog client scripts i need it to evaluate something.
And DOM manipulation is something which no one should use on ServiceNow instances, because of security reasons.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2022 02:09 PM
Can you share the modifications you have tried?
Is seems a lot of the scripts use:
gs.getSession().getAvailableElevatedRoles()
Which means the elevated roles are saved in your session.
So it might be good to test this in a new session, as your current session might still have those results even after you make changes to a script. For example by using a different browser.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2022 02:34 PM
Hi Karl,
Why is it you want to remove this from the menu? If it should not be in the menu, you can uncheck the 'Elevated privilege' on the role and it becomes a normal role that can be assigned.
If it should be an elevated privilege, users need a way to activate that privilege, right? So it should show in the User Menu > Elevate Roles.