I am trying to make a online photo library where user upload image from their mobile devices like Android to the server and can access it. Current I am using Grails with Spring Security Plugin Core and I saved all the uploaded image in a folder in /web-app/uploaded-image. The upload part is currently working and I am able to upload image from my device to the server uploaded-image folder. However, one question I have is that currently I am using these line in my Config.groovy to do the access control part
grails.plugins.springsecurity.interceptUrlMap = [
/uploaded_image/**':['IS_AUTHENTICATED_REMEMBERED']
]
I planned on having the controller associate the image's path to a DomainClass called image which will be associate with each user's DomainClass. My question is that how do I make it so that user that is not the owner of the image would not have permission to view the image? I tried search google for answer and did not find many useful answer. Thank you for your time.