Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
lsli lsli
Making an image viewable in multiple user's image gallery portlets, etc.
22 de Maio de 2011 11:30

lsli lsli

Ranking: Junior Member

Mensagens: 62

Data de entrada: 10 de Novembro de 2008

Mensagens recentes

I have a few specific use cases I need to address. Let me expand on them - and I would appreciate if anyone can help me with these issues.

Users of my website will have the ability to upload images through my own custom portlet. Consequently, I have some Java code (using the IGFolderLocalServiceUtil and IGImageLocalServiceUtil classes) to deal with creating the proper folders and images for this. My code seems to "work" - in this case, adding two images (small and large) to the Image table while adding an appropriate entry into the IGImage table - and thus effectively adds the image to the image gallery.

However, I have some requirements. The current code above adds the image to the image gallery for the user that uploaded the image. This is working as expected. The user who uploaded the image(s) is also able to view the image in his image gallery portlet. However, I also have the requirement that any user that has the community administrator role should be able to see the image in his own image gallery portlet. This would allow the community administrator to easily browse the images uploaded by various users all in one place. It would allow the community administrator to perhaps delete the image, etc. What changes (what additional code do I need to add) do I need to make to do this? Is this even possible - i.e. is the owner (i.e. the person who uploaded the file) the only user able to see the image in the image gallery portlet?

I also have another requirement that the user who uploaded the image must not be able to delete the image. This is a bit unusual, but this is required because the uploaded image will eventually be approved and then used as shared community content. I do not want the owner to delete the image from the image gallery portlet. What API calls do I have to make to ensure that the owner does not have permission to delete the image - and that ONLY a user with the community administrator role has the ability to delete the image from the image gallery portlet?