Hide Elevated Role under User Menu > Elevate Roles

Karl Dietrich
Kilo Sage

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? 

find_real_file.png

find_real_file.png

 

I have tried modifying these UI Macros, but my changes seemingly do not apply to anything, everything stays the same.

find_real_file.png

The same is true for the UI Script "ElevatedRole" and the UI Page "elevated_role_dialog"

 

Thanks in advance

Karl

1 ACCEPTED SOLUTION

Willem
Giga Sage
Giga Sage

Hi Karl,

I see you continued on this here:

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

 

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.

View solution in original post

10 REPLIES 10

Michael Jones -
Giga Sage

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

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

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. 

 

Willem
Giga Sage
Giga Sage

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.

Willem
Giga Sage
Giga Sage

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.