Check what Site Role User Has Snippet

Lee Jordan, modified 5 Years ago. Expert Posts: 449 Join Date: 5/26/15 Recent Posts
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?
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
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.