mdwongadsk
11 years agoAdept
Selectively showing rank icons
We have a request to have our role icons visible to anonymous users. However, some of the icons should only be visible to internal employees. We had all the icons within an <#if coreNode.permissions.hasPermission("view_user_rank_thread_icon")> statement and that restricted all of them, not just the private ones. Can we selectively show these icons to user with varying roles? Default users are currently restricted from viewing rank icons. If we enable Default users to see the icons, then can we selectively hide the private ones?
- Hi and welcome to the Lithium community,
As Lithium doesn't have the concept of "public vs. private ranks" you would need to create that functionality yourself.
At the place where you are currently wrapping the icon display into the permission check you would need to add a whitelist of ranks that expose their icon to public. Have a look at the "rank.id" method of the user FreeMarker context object: https://community.lithium.com/t5/Developers-Knowledge-Base/user-FreeMarker-context-object/ta-p/9339