Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
George Rempousis
Fetching organization users on custom portlet
28 febbraio 2013 1.07
Risposta

George Rempousis

Punteggio: New Member

Messaggi: 7

Data di Iscrizione: 28 gennaio 2013

Messaggi recenti

Hi I'm trying to implement a custom portlet and in the proccess I need to get the id's of the users that belongs to an organization.

I use the :
List<User> organizationUsers = UserServiceUtil.getOrganizationUsers(orgID);

method to achieve that.

when I'm logged in, it is working perfectly
but as guest user (unregistered) I get :

com.liferay.portal.security.auth.PrincipalException exception.


Is there any way that I resolve this issue?

Thanks
Oliver Bayer
RE: Fetching organization users on custom portlet
28 febbraio 2013 1.13
Risposta

Oliver Bayer

Punteggio: Liferay Master

Messaggi: 889

Data di Iscrizione: 18 febbraio 2009

Messaggi recenti

Hi George,

if the current user is not authenticated which you can check by using "themeDisplay.isSignedIn()" you can show sth. else e.g. a warning message that you have to be logged in before using your portlet. Another solution would be to use UserLocalServiceUtil as the ...Local... classes don't have security/ permission checks.

HTH Oli
George Rempousis
RE: Fetching organization users on custom portlet
28 febbraio 2013 1.23
Risposta

George Rempousis

Punteggio: New Member

Messaggi: 7

Data di Iscrizione: 28 gennaio 2013

Messaggi recenti

Thanks Oliver,

worked perfectly

Much appreciated!