Hide/Show footer links to people based on role in Employee center

Praveena KKS
Tera Contributor

Greetings,

I'm trying to hide footer links of employee centre from non ITIL users. But I'm unable to hide because the condition field in the menu items is not working. Please Help me.
Screenshot attached.

3 REPLIES 3

Kieran Anson
Kilo Patron

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.

 

 

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);

 

A_maity002
Tera Contributor

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