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 Discussion:

danish said...

Thanx jignesh it helped a lot...