Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Gaurav Sharma
Identifying the organization site a user is currently logged in to
5. Februar 2013 12:45
Antwort

Gaurav Sharma

Rang: Junior Member

Nachrichten: 38

Eintrittsdatum: 1. November 2012

Neue 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?
David H Nebinger
RE: Identifying the organization site a user is currently logged in to
5. Februar 2013 13:15
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 11046

Eintrittsdatum: 1. September 2006

Neue Beiträge

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
5. Februar 2013 13:21
Antwort

Gaurav Sharma

Rang: Junior Member

Nachrichten: 38

Eintrittsdatum: 1. November 2012

Neue 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.
David H Nebinger
RE: Identifying the organization site a user is currently logged in to
5. Februar 2013 15:12
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 11046

Eintrittsdatum: 1. September 2006

Neue Beiträge

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
5. Februar 2013 19:43
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7949

Eintrittsdatum: 23. März 2010

Neue 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
RE: Identifying the organization site a user is currently logged in to
20. Februar 2013 09:34
Antwort

Gaurav Sharma

Rang: Junior Member

Nachrichten: 38

Eintrittsdatum: 1. November 2012

Neue Beiträge