Foros de discusión

Identifying the organization site a user is currently logged in to

Gaurav Sharma, modificado hace 11 años.

Identifying the organization site a user is currently logged in to

Junior Member Mensajes: 39 Fecha de incorporación: 1/11/12 Mensajes recientes
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, modificado hace 11 años.

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

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Current org should be available in the ThemeDisplay.

Portlets are not org- and/or site-specific.
Gaurav Sharma, modificado hace 11 años.

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

Junior Member Mensajes: 39 Fecha de incorporación: 1/11/12 Mensajes recientes
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, modificado hace 11 años.

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

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
It's going to be one of the group ids, i.e. the company group id or the scope group id...
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

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

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
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, modificado hace 11 años.

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

Junior Member Mensajes: 39 Fecha de incorporación: 1/11/12 Mensajes recientes