Foros de discusión

Using Authorization in Liferay

Hiran Chaudhuri, modificado hace 12 años.

Using Authorization in Liferay

Regular Member Mensajes: 188 Fecha de incorporación: 1/09/10 Mensajes recientes
Hello there.

I want to display some charts in a portlet using amcharts (http://www.amcharts.com/). For reasons unknown to me the javascript code required to setup the flash object does not execute cleanly if I embed everything in the portlet itself. Therefore I created a JSP page that opens in a separate frame to show the chart data, which itself gets loaded from a servlet.

This basically works and is a great relief.
However now security comes into the game: As both the jsp and the servlet do not yet use any authorization, any user would be able to see any chart data available.

Any idea how I could prevent this? Right now I see two solutions, both of which I am unsure of:
- integrate everything into the portlet to make it work inside the portal.
- add code to the jsp and servlet to access some liferay authorization api.

How would you proceed? How would function calls look like here?
Sergio Sanchez, modificado hace 12 años.

RE: Using Authorization in Liferay

Junior Member Mensajes: 41 Fecha de incorporación: 3/02/11 Mensajes recientes
If you have to use the authorization that liferay provides you have to embed all your code inside the portlet I guess. That code that the servlet provides can not be embedded inside a serveResource (JSR-286) method?
Hiran Chaudhuri, modificado hace 12 años.

RE: Using Authorization in Liferay

Regular Member Mensajes: 188 Fecha de incorporación: 1/09/10 Mensajes recientes
Sergio Sanchez:
If you have to use the authorization that liferay provides you have to embed all your code inside the portlet I guess. That code that the servlet provides can not be embedded inside a serveResource (JSR-286) method?

Actually that was the easiest thing to do, I just needed a hint for that. :-))
The portlet works now as it should. Thanks!