Wanted to hide impersonate and logout dropdown under profile in ESC

soumya5
Tera Contributor

soumya5_0-1679662764706.png

 How to hide impersonate and logout dropdown under profile

Can any one help me on this tried by Replacing in place of :
.impersonate-and-logout {
div>ul>li:first-child {
&>a#profile-dropdown{
display: none;
}
below changes should be made:
.impersonate-and-logout {
div>ul>li:first-child {
&>a{
display: none;
}

Any one worked before on this /any suggestions

1 ACCEPTED SOLUTION

Don't understand your remark on the impersonate. Impersonate is only visible to people having the roles to do so. So why hiding this? An end-user without any roles won't see the Impersonate option.

 

 Anyway, higing logout you could achieve multiple ways using CSS. I just really quickly tested with below CSS, works instantly:

 

a[href="/logout.do?sysparm_goto_url=/esc"] {
display: none !important;
}

 

Screenshot 2023-03-26 075428.png

 

If you still also want to hide Impersonate, you can use the same principle.

 

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

4 REPLIES 4

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

You could hide those options using CSS. That way you don't have to edit any widgets.

Question though, why do you want to hide these options? Like impersonation, could be really useful for your admins I would assume? Impersonation is not visible for your end-users by default.

 

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

soumya5
Tera Contributor

Hi Mark, 
           Thanks mark for your reply. Actually the requirement is for: non-admin users should not be able to impersonate and logout and when they click on profile icon it must show just user profile.
I tried to hide from css but It's not working , Is there Any way; help is appreciated.

Tried by below but it doesn't work for me

Logout button not visibile for ESC portal for non admin users - Known Error (servicenow.com)

 

 Thanks, 
Soumya

Don't understand your remark on the impersonate. Impersonate is only visible to people having the roles to do so. So why hiding this? An end-user without any roles won't see the Impersonate option.

 

 Anyway, higing logout you could achieve multiple ways using CSS. I just really quickly tested with below CSS, works instantly:

 

a[href="/logout.do?sysparm_goto_url=/esc"] {
display: none !important;
}

 

Screenshot 2023-03-26 075428.png

 

If you still also want to hide Impersonate, you can use the same principle.

 

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Thank you. This is really helpful to me. 

However is there a way to hide 'Profile' option in the drop down?

I tried to use the following but the sys is is dynamic based on log in user.

 

a[href="?id=hri_user_profile&sys_id=d5dea573c37646d44121fbba050131f4"]{
display: none !important;
}