Foren

Identifying the organization site a user is currently logged in to

Gaurav Sharma, geändert vor 11 Jahren.

Identifying the organization site a user is currently logged in to

Junior Member Beiträge: 39 Beitrittsdatum: 01.11.12 Neueste Beiträge
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?
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Identifying the organization site a user is currently logged in to

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Current org should be available in the ThemeDisplay.

Portlets are not org- and/or site-specific.
Gaurav Sharma, geändert vor 11 Jahren.

RE: Identifying the organization site a user is currently logged in to

Junior Member Beiträge: 39 Beitrittsdatum: 01.11.12 Neueste Beiträge
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.
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Identifying the organization site a user is currently logged in to

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
It's going to be one of the group ids, i.e. the company group id or the scope group id...
thumbnail
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: Identifying the organization site a user is currently logged in to

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: Identifying the organization site a user is currently logged in to (Antwort)

Junior Member Beiträge: 39 Beitrittsdatum: 01.11.12 Neueste Beiträge