Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Gwowen Fu
Get impersonated User ID using Javascript
5. April 2013 14:32
Antwort

Gwowen Fu

Rang: Expert

Nachrichten: 315

Eintrittsdatum: 27. Dezember 2010

Neue Beiträge

Hi,
I am using Liferay Javascript API to create a resource URL. It works fine with my account. When I impersonate someone else then the link won't work.

I think I need to add "doAsUserId" to the URL, my question is how do I get the encrypted impersonated user ID?

Does Liferay Javascript API provides a way to get that?

1   
2var resourceURL= Liferay.PortletURL.createResourceURL();
3resourceURL.setResourceId(methodName);
4resourceURL.setPortletMode("view");
5resourceURL.setWindowState("normal");
6resourceURL.setPortletId("fusion_WAR_learnplugin");


Thanks!
Gwowen
Mika Koivisto
RE: Get impersonated User ID using Javascript
5. April 2013 16:58
Antwort

Mika Koivisto

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1513

Eintrittsdatum: 7. August 2006

Neue Beiträge

The themeDisplay javascript object has the doAsUserId in encrypted form and you can pass it as is in the ajax call using parameter name doAsUserId.
Gwowen Fu
RE: Get impersonated User ID using Javascript
6. April 2013 15:11
Antwort

Gwowen Fu

Rang: Expert

Nachrichten: 315

Eintrittsdatum: 27. Dezember 2010

Neue Beiträge

Thanks, I will try that.