Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Check what Site Role User Has Snippet
To check in theme if user is a portal admin, site admin or site owner of the current site add this to init_custom.ftl in /src directory of theme.
<#if is_signed_in>
<#if permissionChecker.isOmniadmin()><#assign is_portal_admin = true /></#if>
<#if permissionChecker.isGroupAdmin(group_id)><#assign is_site_admin = true /></#if>
<#if permissionChecker.isGroupOwner(group_id)><#assign is_site_owner = true /></#if>
</#if>
Anyone know how to find out if the user is a member of the current site so I can do is_joined or is_site_member?
<#if is_signed_in>
<#if permissionChecker.isOmniadmin()><#assign is_portal_admin = true /></#if>
<#if permissionChecker.isGroupAdmin(group_id)><#assign is_site_admin = true /></#if>
<#if permissionChecker.isGroupOwner(group_id)><#assign is_site_owner = true /></#if>
</#if>
Anyone know how to find out if the user is a member of the current site so I can do is_joined or is_site_member?
You can use the permission checker to see if the user has the ability to, say, post a comment on an article. That's something that is usually granted to members but not to guests and the permission checker can easily resolve that for you.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™