Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Gaurav Sharma
Identifying the organization site a user is currently logged in to
February 5, 2013 12:45 PM
Answer

Gaurav Sharma

Rank: Junior Member

Posts: 38

Join Date: November 1, 2012

Recent Posts

With Liferay, you have the ability to create organizational sites. Let's say a user has access to more than one organization. He can therefore, switch between organizations using the "Go To->" link on the top right.

I need to find out which site is being viewed using Java code in the portlet. Is that possible?

Additionally, can I limit which portlets can be deployed on which site?
David H Nebinger
RE: Identifying the organization site a user is currently logged in to
February 5, 2013 1:15 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7238

Join Date: September 1, 2006

Recent Posts

Current org should be available in the ThemeDisplay.

Portlets are not org- and/or site-specific.
Gaurav Sharma
RE: Identifying the organization site a user is currently logged in to
February 5, 2013 1:21 PM
Answer

Gaurav Sharma

Rank: Junior Member

Posts: 38

Join Date: November 1, 2012

Recent Posts

I'm looking at the class (com.liferay.portal.theme.ThemeDisplay ) in http://docs.liferay.com/portal/6.1/javadocs/ and I don't see any Organization-specific method.

I thought as much about the portlets but figured it's better to confirm.

Thanks.
David H Nebinger
RE: Identifying the organization site a user is currently logged in to
February 5, 2013 3:12 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7238

Join Date: September 1, 2006

Recent Posts

It's going to be one of the group ids, i.e. the company group id or the scope group id...
Hitoshi Ozawa
RE: Identifying the organization site a user is currently logged in to
February 5, 2013 7:43 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

I need to find out which site is being viewed using Java code in the portlet. Is that possible?


Are you trying to track user? If you just want to know which organization the page is related to, I think you can use
LayoutLocalServiceImpl.getLayout to the the layout and use getGroup.

Additionally, can I limit which portlets can be deployed on which site?


Permission is based on normal roles so it'll be difficult to do from liferay framework. Also, plugins are deployed to the application container and not to a site. Nevertheless, I think it'll be possible to restrict access to a portlet usage based on which site page it is placed on. (note, this is different from restricting admin from adding portlets to a site page.)
Gaurav Sharma
RE: Identifying the organization site a user is currently logged in to
February 20, 2013 9:34 AM
Answer

Gaurav Sharma

Rank: Junior Member

Posts: 38

Join Date: November 1, 2012

Recent Posts