we want to check in a Liferay-Theme for 6.1.1 GA2, if the currently signed in user has a role e.g. "myRole".
The role is defined and assigned to the user, by adding the user to a group where this role is assigned.
When i check the user roles in control panel, the group is shown correctly for that user in the user list. Editing the user, the Roles-Panel shows in "Inherited Roles" the assigned group.
In theme a simple
#set ($usrRoles = $user.getRoles())
#foreach( $usrRole in $usrRoles )
<p>$usrRole.getName()</p>
#end
only returns the directly assigned roles not the from group inherited roles.
Is there another method to get these roles? Or is this just one more bug in Liferay?