Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
sasmita swain
role
November 4, 2012 8:16 PM
Answer

sasmita swain

Rank: Regular Member

Posts: 174

Join Date: February 24, 2012

Recent Posts

hi

i want to display if role is admin then serach container would display,if role is not admin then search container should not display..

how to do?

Thanks
jaid shaik
RE: role
November 4, 2012 8:25 PM
Answer

jaid shaik

Rank: Regular Member

Posts: 170

Join Date: October 7, 2010

Recent Posts

Hi sasmita swain,

1if(permissionChecker.isCompanyAdmin(themeDisplay.getCompanyId())){
2
3//display content for admin
4}


I think the above code is helpful to you.



Thanks
sasmita swain
RE: role
November 4, 2012 8:30 PM
Answer

sasmita swain

Rank: Regular Member

Posts: 174

Join Date: February 24, 2012

Recent Posts

jaid shaik:
Hi sasmita swain,

1if(permissionChecker.isCompanyAdmin(themeDisplay.getCompanyId())){
2
3//display content for admin
4}


I think the above code is helpful to you.



Thanks


thanks for your reply..

what is the role for user?
jaid shaik
RE: role
November 4, 2012 9:47 PM
Answer

jaid shaik

Rank: Regular Member

Posts: 170

Join Date: October 7, 2010

Recent Posts

Hi sasmita swain,

The above code is
if user has admin role content will display.
if user doesn't have admin role it won't display.


For theme use below code.

1#if( $permissionChecker.isCompanyAdmin($company_id))
2
3#end
sasmita swain
RE: role
November 5, 2012 1:31 AM
Answer

sasmita swain

Rank: Regular Member

Posts: 174

Join Date: February 24, 2012

Recent Posts

hi

how to retreive parent category with category name from db in shopping portlet????parent category is displaying 0.
jaid shaik
RE: role
November 5, 2012 3:53 AM
Answer

jaid shaik

Rank: Regular Member

Posts: 170

Join Date: October 7, 2010

Recent Posts

Hi sasmita,

check this link

I think it helpful to you.



Thanks
sasmita swain
RE: role
November 5, 2012 8:59 PM
Answer

sasmita swain

Rank: Regular Member

Posts: 174

Join Date: February 24, 2012

Recent Posts

hi
how to retreive categories with sub categories in one page???
my code is:
<%List<ShoppingCategory> li=ShoppingCategoryLocalServiceUtil.getCategories(10180);%>
<%
long categoryId=0;
for(ShoppingCategory shop:li){
if(shop.getParentCategoryId()==0 && shop.getGroupId()==10180){
categoryId=shop.getCategoryId();
%>
<h1><%=shop.getName() %></h1>

<%}else{ if(categoryId==shop.getParentCategoryId()){%>
<u1><li><a><%=shop.getName()%></a></li></u1>

<%
}

}
%>
}
only last value is comming

can any one help meout?

Thanks
Sasmita
Attachment

Attachments: 2012-11-06 10-22-35_01 Store Landing page - Windows Photo Viewer.png (5.2k)
Priyanka Dhingra
RE: role
November 6, 2012 4:27 AM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

You can use
1RoleLocalServiceUtil.hasUserRole(long userId, long companyId, String name, boolean inherited);
for your role check requirement

and please generate a new thread for your new problem