.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:
- i have checked .htaccess file not useful since liferay has tomcat rather apache server.
- created filter class can intercept request made should process through.
- 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
Post a Comment