Hide/Show footer links to people based on role in Employee center
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 03:29 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 04:15 AM
Hi,
Employee Center uses scope caching to improve load times. This does however mean that changes aren't reflecting until the scoped cache key is invalidated / removed, or you logout and back in.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 04:18 AM
If you're doing a lot of iterative development on the footer, you can use the following script in Xplore (change your scope to Employee Center [sn_ex_sp])
var portalId = "70cd9f3b734b13001fdae9c54cf6a72f"; //sys_id of employee portal
var cacheKey = 'footerDetails_'.concat(portalId, '_', gs.getSession().getLanguage());
var footerDetailsFromCache = sn_scoped_cache.ScopedCacheManager.flushScopedCache('employee_center_cache', cacheKey);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 04:22 AM
Hello @Praveena KKS ,
I can suggest you two options:
1) You can try this -> javascript:gs.hasRole('itil')
This might work.
2) or else you can create a client script like below:
function hideFooterLinkForNonITIL() {
var isITILUser = false;
if (g_user.hasRole('itil')) {
isITILUser = true;
}
if (!isITILUser) {
// Replace 'footerLinkID' with the actual ID of your footer link element
document.getElementById('footerLinkID').style.display = 'none';
}
}
document.addEventListener('DOMContentLoaded', function() {
hideFooterLinkForNonITIL();
});
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Thanks,
Atanu Maity