14 September, 2012

Get user roles in theme velocity template

Many times we have requirement coming out to fetch user roles in theme velocity template (.vm) file.
So below code you can use for Liferay 6.X :


#set($role=$serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
$role.getUserRoles($user_id)

Hope this will useful !!!
Best,
Jignesh Vachhani

Rate Me:

1 comment:

Your Comments on this post

Create Servlet Project as Module

You would have seen that many times we are writing out own servlet in Liferay portal to achieve some specific use case. In DXP, You can st...