Hide Menu Items on ESC Header Menu for snc_external role

amielalcala
Kilo Sage

Hi,

 

The client wants to hide My Requests, Favorites, Profile Dropdown, and Tours from the ESC Portal header from snc_external users. I checked the header menu items to try and add conditions but I don't see it there. Is there any other way to hide these for users with snc_external role?

 

amielalcala_1-1706699564604.png

 

Appreciate any help I can get. Thanks!

Dr Atul G- LNG
Tera Patron

Hi @amielalcala 

 

https://www.servicenow.com/community/developer-forum/hiding-menu-items-for-sp-header-in-service-port...

 

https://www.servicenow.com/community/developer-forum/how-to-hide-show-service-portal-menus-based-on-...

 

https://www.servicenow.com/community/developer-forum/hide-portal-header-menu-items/m-p/1562217

 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG,

 

I checked on the portal menus but unfortunately, I don't see the ones I have mentioned. This is the only one I see. Do I need to modify something on the menu server script?

 

amielalcala_0-1706702317592.png

 

See my comment:

"Note that these are also in fact not menu items. That also makes that the response from Atul is incorrect."

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Hi @Mark Roethof,

 

Oh, thanks for pointing that out! If that's the case, shall I add a condition on the header server script? I tried adding a condition but when I impersonate snc_external, it still shows up. Here's the condition I added:

    data.user_role = gs.getUser().hasRole("sys_user_role");

	if (
		data.user_role == '940ba702933002009c8579b4f47ffbe2'

	) {
		data.adminHeader = false;

	} else {
		data.adminHeader = true;
	}