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

It should be something like a technical role in the background which is not for manual use.

I want to use it in scripts to grant some kind of temporary permission to the script.

Allen Andreas
Administrator
Administrator

Hello,

You're not really giving us the full context, unless you literally mean you don't want that role to show. If that's the case, then navigate to that role within your instance and uncheck the "elevated role" checkbox on the role form.

Otherwise, if you gave them that role, it was expected that they'd need to elevate to it to use it. If this is not the case, then as I mentioned above, remove the elevated privilege need...or remove it from those users and unnest it, etc., if applicable.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Allen,

I have a field which is needs to be unaccessible for all users except admins, but I still need the field in some client scripts and catalog client scripts to evaluate something and I did not find any other way to accomplish that but to create an elevated role which gets enabled/disabled via a script. 

// ENABLE
GlideSecurityManager.get().enableElevatedRole('employee_number_user');

//DISABLE
GlideSecurityManager.get().disableElevatedRole('employee_number_user');

 

Maybe you know how to do it in a cleaner way?

 

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.

Ahhh okay I see I wanted to over engineer my solution, you just need to create an ACL with a role and the normal users wont see the field and business rules/script includes ignore that ACL anyway when you use GlideRecord.