Is there any recommended way to limit domain visibility in grails?
Usually you do something like getting an interface for external use:
def productList = Product.list() withFormat { html {[productList:productList]} json { render productList as JSON } xml { render productList as XML } rss { render(feedType:"rss", productList)} }
which is equal
SELECT * FROM product
But by default there are properties in the domain that should not be populated. Therefore i need to say something
SELECT id, name, foo1, foo2 FROM product
therefore, only a list of properties is included in the response.
skurt source share