Wednesday, April 27, 2011

How to check portlet Owner and Logged in User in Liferay

<%

Group gr=themeDisplay.getLayout().getGroup();

UserLocalServiceUtil usu = new UserLocalServiceUtil();

User owner1 = (User)usu.getUserById(gr.getCreatorUserId());

if(owner1.getUserId()==user.getUserId())

out.println("You are the OWNER of portlet
");

else

out.println("You are NOT OWNER of this portlet
");

%>