To perform the accesing of the service layers in web content we need to add the propertie in the portal-ext.properties file
journal.template.velocity.restricted.variables=
#set($roleLocalServiceUtil = $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
#set($adminrole = $roleLocalServiceUtil.getRole($company_id, "Administrator"))
#set($hasadminrole = $roleLocalServiceUtil.hasUserRole($user_id, $getterUtil.getLong($adminrole.getRoleId())))
journal.template.velocity.restricted.variables=
#set($roleLocalServiceUtil = $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
#set($adminrole = $roleLocalServiceUtil.getRole($company_id, "Administrator"))
#set($hasadminrole = $roleLocalServiceUtil.hasUserRole($user_id, $getterUtil.getLong($adminrole.getRoleId())))
1 comment:
Thank U Inthiaz
Post a Comment