.htaccess - disallow access of internal files in liferay -


in liferay have
--tomcat
  --webapps
   --myimages
   --my-portlet
using code in my-portlet have given links given file in myimages folder specific user.
link
http://localhost:8080/myimages/user1.jpg

problem statement: have restrict user (rather defined role in liferay) s/he should not able access of files in myimages folder s/he user hits on direct above link.

what have tested:

  1. i have checked .htaccess file not useful since liferay has tomcat rather apache server.
  2. created filter class can intercept request made should process through.
  3. openldap can not use since having separate authentication mechanism.
    if has idea how deal security issue, please suggest me.

urls resolved through individual webapps (like myimages), not through liferay, not have idea of user accesses liferay: they'll shielded other (and in case totally unrelated) webapplication liferay.

what can provide these files through portlet plugins , serve images through resource-urls in portlet. goes through portal context (in fact, urls point liferay, despite implementation in different webapplication) , you'll able check permissions of current user. read file , pipe resourceresponse's output stream.

if files indeed static web resources, might want put them in myimages/web-inf/images - tomcat refuse directly serve under web-inf, portlet able access these files.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -