I'm developing an application display template (freemarker) for the sitemap portlet to render in my layout in the pages footer. So far everything works. I can iterate through my pages and render the correct result. Checks on whether a page is hidden work as well.
Now I need one more feature. I want to check whether a page is accessible by logged users only (= don't show a link to a guest user when the page permissions forbid guests to see the page).
Here is my ADT code.
<#if entries?has_content>
<#list entries as entry>
<#assign layoutURL = portalUtil.getLayoutURL(entry, themeDisplay)>
<div class="grid3">
<ul>
<#if entry.isHidden() == false>
<li><a href="${layoutURL}">${entry.getName(locale)}</a></li>
</#if>
</ul>
</div>
</#list>
</#if>
Maybe ${themeDisplay.getPermissionChecker()}
can do the trick but I don't really have a clue on how to check for a users permissions on page. In a perfect world I can distinguish between different user groups but I'd settle for show when logged in, hide when anonymous (=guest).
I'm using Liferay 6.2. Anyone got an idea?